
    |h                     Z    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	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   )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                 (    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.
        detect)r   taskN)super__init__)selfr   	__class__s     ^/var/www/html/test/engine/venv/lib/python3.12/site-packages/ultralytics/models/rtdetr/model.pyr   zRTDETR.__init__(   s     	u8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    &5c 5d 5 
$ 
 
r   r
   N)r   ultralytics.engine.modelr   ultralytics.nn.tasksr   predictr   trainr   valr   r
    r   r   <module>r)      s'    + 5 $    ,
U ,
r   