o
    VhG                     @   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 )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   )RTDETRPredictor)RTDETRTrainer)RTDETRValidatorc                       s>   e Zd ZdZd
deddf fddZedefdd	Z  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.

    Examples:
        >>> from ultralytics import RTDETR
        >>> model = RTDETR("rtdetr-l.pt")
        >>> results = model("image.jpg")
    rtdetr-l.ptmodelreturnNc                    s   t  j|dd dS )a0  
        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.

        Raises:
            NotImplementedError: If the model file extension is not 'pt', 'yaml', or 'yml'.
        detect)r
   taskN)super__init__)selfr
   	__class__ S/var/www/vscode/kcb/lib/python3.10/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   )	predictor	validatortrainerr
   )r   r   r   r   )r   r   r   r   task_map0   s   	zRTDETR.task_map)r	   )
__name__
__module____qualname____doc__strr   propertydictr   __classcell__r   r   r   r   r      s
    r   N)r   ultralytics.engine.modelr   ultralytics.nn.tasksr   predictr   trainr   valr   r   r   r   r   r   <module>   s   
