Ë
    FêñiÝ  ã                   óf   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ  G d	„ d
e«      Zy)ag  
Interface for Baidu's RT-DETR, a Vision Transformer-based real-time object detector.

RT-DETR offers real-time performance and high accuracy, excelling in accelerated backends like CUDA with TensorRT.
It features an efficient hybrid encoder and IoU-aware query selection for enhanced detection accuracy.

References:
    https://arxiv.org/pdf/2304.08069.pdf
é    )ÚModel)ÚRTDETRDetectionModel)Ú
TORCH_1_11é   )ÚRTDETRPredictor)ÚRTDETRTrainer)ÚRTDETRValidatorc                   óD   ‡ — e Zd ZdZddeddfˆ fd„Zedefd„«       Zˆ xZ	S )ÚRTDETRa†  Interface for Baidu's RT-DETR model, a Vision Transformer-based real-time object detector.

    This model provides real-time performance with high accuracy. It supports efficient hybrid encoding, IoU-aware query
    selection, and adaptable inference speed.

    Attributes:
        model (str): Path to the pre-trained model.

    Methods:
        task_map: Return a task map for RT-DETR, associating tasks with corresponding Ultralytics classes.

    Examples:
        Initialize RT-DETR with a pre-trained model
        >>> from ultralytics import RTDETR
        >>> model = RTDETR("rtdetr-l.pt")
        >>> results = model("image.jpg")
    ÚmodelÚreturnNc                 óB   •— t         sJ d«       ‚t        ‰| �	  |d¬«       y)zºInitialize the RT-DETR model with the given pre-trained model file.

        Args:
            model (str): Path to the pre-trained model. Supports .pt, .yaml, and .yml formats.
        zRTDETR requires torch>=1.11Údetect)r   ÚtaskN)r   ÚsuperÚ__init__)Úselfr   Ú	__class__s     €úa/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/ultralytics/models/rtdetr/model.pyr   zRTDETR.__init__(   s%   ø€ õ Ð8Ð8Ó8ˆzÜ‰Ñ˜u¨8ÐÕ4ó    c                 ó4   — dt         t        t        t        dœiS )zÚReturn a task map for RT-DETR, associating tasks with corresponding Ultralytics classes.

        Returns:
            (dict): A dictionary mapping task names to Ultralytics task classes for the RT-DETR model.
        r   )Ú	predictorÚ	validatorÚtrainerr   )r   r	   r   r   )r   s    r   Útask_mapzRTDETR.task_map1   s"   € ð Ü,Ü,Ü(Ü-ñ	ð
ð 	
r   )zrtdetr-l.pt)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   ÚpropertyÚdictr   Ú__classcell__)r   s   @r   r   r      s6   ø„ ññ$5˜cð 5°dõ 5ð ð
˜$ò 
ó ô
r   r   N)r   Úultralytics.engine.modelr   Úultralytics.nn.tasksr   Úultralytics.utils.torch_utilsr   Úpredictr   Útrainr   Úvalr	   r   © r   r   ú<module>r+      s*   ðñõ +Ý 5Ý 4å $Ý  Ý  ô*
ˆUõ *
r   