§
    ezni6  ã                   óH   — d dl Z d dlmZ d dlmZ dgZ G d„ de¦  «        ZdS )é    N)ÚDetectionValidator)ÚopsÚNASValidatorc                   ó   — e Zd ZdZd„ ZdS )r   a   
    Ultralytics YOLO NAS Validator for object detection.

    Extends `DetectionValidator` from the Ultralytics models package and is designed to post-process the raw predictions
    generated by YOLO NAS models. It performs non-maximum suppression to remove overlapping and low-confidence boxes,
    ultimately producing the final detections.

    Attributes:
        args (Namespace): Namespace containing various configurations for post-processing, such as confidence and IoU thresholds.
        lb (torch.Tensor): Optional tensor for multilabel NMS.

    Example:
        ```python
        from ultralytics import NAS

        model = NAS('yolo_nas_s')
        validator = model.validator
        # Assumes that raw_preds are available
        final_preds = validator.postprocess(raw_preds)
        ```

    Note:
        This class is generally not instantiated directly but is used internally within the `NAS` class.
    c           
      óD  — t          j        |d         d         ¦  «        }t          j        ||d         d         fd¦  «                             ddd¦  «        }t          j        || j        j        | j        j        | j	        d| j        j
        | j        j        d¬¦  «        S )z4Apply Non-maximum suppression to prediction outputs.r   é   éÿÿÿÿé   Fg      à?)ÚlabelsÚmulti_labelÚagnosticÚmax_detÚmax_time_img)r   Ú	xyxy2xywhÚtorchÚcatÚpermuteÚnon_max_suppressionÚargsÚconfÚiouÚlbÚ
single_clsr   )ÚselfÚpreds_inÚboxesÚpredss       úz/var/www/html/cool-property-finder/image-detection-backend/venv/lib/python3.11/site-packages/ultralytics/models/nas/val.pyÚpostprocesszNASValidator.postprocess%   sŽ   € å”˜h qœk¨!œnÑ-Ô-ˆÝ”	˜5 (¨1¤+¨a¤.Ð1°2Ñ6Ô6×>Ò>¸qÀ!ÀQÑGÔGˆÝÔ& uØ'+¤y¤~Ø'+¤y¤}Ø.2¬gØ38Ø04´	Ô0DØ/3¬yÔ/@Ø47ð9ñ 9ô 9ð 	9ó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r    r   r   r      s-   € € € € € ðð ð29ð 9ð 9ð 9ð 9r    )r   Úultralytics.models.yolo.detectr   Úultralytics.utilsr   Ú__all__r   r%   r    r   ú<module>r)      sq   ðð €€€à =Ð =Ð =Ð =Ð =Ð =Ø !Ð !Ð !Ð !Ð !Ð !àÐ
€ð%9ð %9ð %9ð %9ð %9Ð%ñ %9ô %9ð %9ð %9ð %9r    