a
    yf                     @   sT   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
 G dd	 d	eZd
S )a~  
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.

For more information on RT-DETR, visit: https://arxiv.org/pdf/2304.08069.pdf
    )Model)RTDETRDetectionModel   )RTDETRPredictor)RTDETRTrainer)RTDETRValidatorc                       s:   e Zd ZdZd	dd fddZeedddZ  ZS )
RTDETRaT  
    Interface for Baidu's RT-DETR model. This Vision Transformer-based object detector 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. Defaults to 'rtdetr-l.pt'.
    rtdetr-l.ptN)returnc                    s   t  j|dd dS )aE  
        Initializes the RT-DETR model with the given pre-trained model file. Supports .pt and .yaml formats.

        Args:
            model (str): Path to the pre-trained model. Defaults to 'rtdetr-l.pt'.

        Raises:
            NotImplementedError: If the model file extension is not 'pt', 'yaml', or 'yml'.
        detect)modeltaskN)super__init__)selfr   	__class__ [/var/www/html/django/DPS/env/lib/python3.9/site-packages/ultralytics/models/rtdetr/model.pyr      s    
zRTDETR.__init__c                 C   s   dt tttdiS )z
        Returns 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   )Z	predictor	validatorZtrainerr   )r   r   r   r   )r   r   r   r   task_map'   s    	zRTDETR.task_map)r	   )	__name__
__module____qualname____doc__r   propertydictr   __classcell__r   r   r   r   r      s   r   N)r   Zultralytics.engine.modelr   Zultralytics.nn.tasksr   Zpredictr   trainr   valr   r   r   r   r   r   <module>   s   