Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Leon 2fbf7015b9
`ultralytics 8.3.99` New YOLOE Open-Vocabulary Models (#19775)
4 months ago
..
2fbf7015b9
`ultralytics 8.3.99` New YOLOE Open-Vocabulary Models (#19775)
4 months ago
d3556a6076
Use lowercase `dict/list/tuple` for type hint in docstrings (#19771)
5 months ago

README.md

You have to be logged in to leave a comment. Sign In

RT-DETR Object Detection with ONNX Runtime

This project demonstrates how to run Ultralytics RT-DETR models using the ONNX Runtime inference engine in Python. It provides a straightforward example for performing object detection with RT-DETR models that have been exported to the ONNX format, a standard for representing machine learning models. RT-DETR, or Real-Time DEtection TRansformer, offers efficient and accurate object detection capabilities, detailed further in the RT-DETR research paper.

⚙️ Installation

To get started, you'll need to install the necessary dependencies. Follow the steps below.

Installing Required Dependencies

Install the core requirements using pip and the provided requirements.txt file:

pip install -r requirements.txt

Installing onnxruntime-gpu (Optional)

For accelerated inference using an NVIDIA GPU, install the onnxruntime-gpu package. Ensure you have the correct NVIDIA drivers and CUDA toolkit installed first. Consult the official ONNX Runtime GPU documentation for detailed compatibility information and setup instructions.

pip install onnxruntime-gpu

Installing onnxruntime (CPU)

If you don't have a compatible GPU or prefer CPU-based inference, install the standard onnxruntime package. This version utilizes CPU resources for model execution. See the ONNX Runtime Execution Providers documentation for more information on different execution options.

pip install onnxruntime

🚀 Usage

Once the dependencies are installed, you can run inference using the main.py script.

Execute the script from your terminal, specifying the path to your ONNX model, the input image, and optional confidence and IoU thresholds:

python main.py --model rtdetr-l.onnx --img image.jpg --conf-thres 0.5 --iou-thres 0.5

Arguments:

Adjust the --conf-thres and --iou-thres values based on your specific requirements for detection sensitivity and overlap removal.

🤝 Contributing

Contributions to enhance this example are welcome! Whether it's fixing bugs, adding new features, improving documentation, or suggesting optimizations, your input is valuable. Please refer to the Ultralytics Contribution Guide for detailed information on how to get started. You can also explore general guides on contributing to open source projects. Thank you for helping improve the Ultralytics ecosystem and its resources available on GitHub!

Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...