ง
    /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        ๚e/home/longshao/multi-rider-rag/.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   