Skip to content

Ultralytics RT-DETR (Realtime Detection Transformer)

Notifications You must be signed in to change notification settings

bharath5673/RT-DETR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

RT-DETR (Tracker)

Ultralytics YOLOv8 Docs RT-DETR (Realtime Detection Transformer) Baidu's RT-DETR: A Vision Transformer-Based Real-Time Object Detector Overview Real-Time Detection Transformer (RT-DETR), developed by Baidu, is a cutting-edge end-to-end object detector that provides real-time performance while maintaining high accuracy. It leverages the power of Vision Transformers (ViT) to efficiently process multiscale features by decoupling intra-scale interaction and cross-scale fusion. RT-DETR is highly adaptable, supporting flexible adjustment of inference speed using different decoder layers without retraining. The model excels on accelerated backends like CUDA with TensorRT, outperforming many other real-time object detectors.

Project Image

Features:

Efficient Hybrid Encoder: Baidu's RT-DETR uses an efficient hybrid encoder that processes multiscale features by decoupling intra-scale interaction and cross-scale fusion. This unique Vision Transformers-based design reduces computational costs and allows for real-time object detection. IoU-aware Query Selection: Baidu's RT-DETR improves object query initialization by utilizing IoU-aware query selection. This allows the model to focus on the most relevant objects in the scene, enhancing the detection accuracy. Adaptable Inference Speed: Baidu's RT-DETR supports flexible adjustments of inference speed by using different decoder layers without the need for retraining. This adaptability facilitates practical application in various real-time object detection scenarios.

Pre-trained Models

The Ultralytics Python API provides pre-trained PaddlePaddle RT-DETR models with different scales:

  • RT-DETR-L: 53.0% AP on COCO val2017, 114 FPS on T4 GPU
  • RT-DETR-X: 54.8% AP on COCO val2017, 74 FPS on T4 GPU

Prerequisites

  • Python 3.x
  • OpenCV
  • PyTorch
  • NumPy

Installation

  1. Clone this repository.
  2. Install the required dependencies
conda create -n test1 python=3.10 -y
conda activate test1
pip install torch ultralytics opencv numpy

Usage

  1. Provide the video path in the code.
  2. set [track=False] on line 97, if dont want to track objects else ignore..
  3. Run the script.
  4. View the results.

For more detailed usage instructions and options, refer to the project documentation.

Run

python3 demo.py

demo

RT-DETR

demo

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

Acknowledgements

Expand

Releases

No releases published

Packages

No packages published

Languages