a
    yµÿfÊ  ã                   @   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 )a3  
    Adjust bounding boxes to stick to image border if they are within a certain threshold.

    Args:
        boxes (torch.Tensor): (n, 4)
        image_shape (tuple): (height, width)
        threshold (int): pixel threshold

    Returns:
        adjusted_boxes (torch.Tensor): adjusted bounding boxes
    é    Né   é   é   © )ZboxesZimage_shapeÚ	thresholdÚhÚwr   r   ú\/var/www/html/django/DPS/env/lib/python3.9/site-packages/ultralytics/models/fastsam/utils.pyÚadjust_bboxes_to_image_border   s      r   N)r   )r   r   r   r   r
   Ú<module>   ó    