o
    Vñhƒ  ã                   @   s   ddd„Z dS )é   c                 C   s„   |\}}d| | dd…df |k df< d| | dd…df |k df< || | dd…df || kdf< || | dd…df || 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[int, int]): Image dimensions as (height, width).
        threshold (int): Pixel threshold for considering a box close to the border.

    Returns:
       boxes (torch.Tensor): Adjusted bounding boxes with shape (n, 4).
    é    Né   é   é   © )ÚboxesÚimage_shapeÚ	thresholdÚhÚwr   r   úT/var/www/vscode/kcb/lib/python3.10/site-packages/ultralytics/models/fastsam/utils.pyÚadjust_bboxes_to_image_border   s     r   N)r   )r   r   r   r   r   Ú<module>   s   