§
    ²Æjo  ã                   ó   — dd„Z dS )é   c                 óÄ   — |\  }}d| | dd…df         |k     df<   d| | dd…df         |k     df<   || | dd…df         ||z
  k    df<   || | dd…df         ||z
  k    df<   | S )aœ  Adjust bounding boxes to stick to image border if they are within a certain threshold.

    Args:
        boxes (torch.Tensor): Bounding boxes with shape (N, 4) in xyxy format.
        image_shape (tuple): Image dimensions as (height, width).
        threshold (int): Pixel threshold for considering a box close to the border.

    Returns:
        (torch.Tensor): Adjusted bounding boxes with shape (N, 4).
    é    Né   é   é   © )ÚboxesÚimage_shapeÚ	thresholdÚhÚws        úc/var/www/html/Carbon-Document/venv/lib/python3.11/site-packages/ultralytics/models/fastsam/utils.pyÚadjust_bboxes_to_image_borderr      sœ   € ð D€A€qð )*€Eˆ%1Œ+˜	Ò
! 1Ð
$Ñ%Ø()€Eˆ%1Œ+˜	Ò
! 1Ð
$Ñ%Ø,-€Eˆ%1Œ+˜˜I™Ò
% qÐ
(Ñ)Ø,-€Eˆ%1Œ+˜˜I™Ò
% qÐ
(Ñ)Ø€Ló    N)r   )r   r   r   r   ú<module>r      s#   ððð ð ð ð ð r   