Run YOLOv10 model with ONNX Runtime
Project description
ONNX YOLOv10 Object Detection
Python scripts performing object detection using the YOLOv10 model in ONNX.
[!CAUTION] I skipped adding the pad to the input image when resizing, which might affect the accuracy of the model if the input image has a different aspect ratio compared to the input size of the model. Always try to get an input size with a ratio close to the input images you will use.
Requirements
- Check the requirements.txt file.
- For ONNX, if you have a NVIDIA GPU, then install the onnxruntime-gpu, otherwise use the onnxruntime library.
Installation
pip install yolov10-onnx
Or, clone this repository:
git clone https://github.com/ibaiGorordo/ONNX-YOLOv10-Object-Detection.git
cd ONNX-YOLOv10-Object-Detection
pip install -r requirements.txt
ONNX Runtime
For Nvidia GPU computers:
pip install onnxruntime-gpu
Otherwise:
pip install onnxruntime
ONNX model
- If the model file is not found in the models directory, it will be downloaded automatically from the HuggingFace.
- Available models: yolov10n.onnx, yolov10s.onnx, yolov10m.onnx, yolov10b.onnx, yolov10l.onnx, yolov10x.onnx
Original YOLOv10 model
The original YOLOv10 model can be found in this repository: https://github.com/THU-MIG/yolov10
- The License of the models is AGPL-3.0 license: https://github.com/THU-MIG/yolov10/blob/main/LICENSE
Examples
- Image inference:
python image_object_detection.py
- Webcam inference:
python webcam_object_detection.py
- Video inference: https://youtu.be/X_XVkEqgCUM
python video_object_detection.py
References:
- YOLOv10 model: https://github.com/THU-MIG/yolov10
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yolov10_onnx-0.1.0.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for yolov10_onnx-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdced8149648181c042f413f245a225afff88a2d633e4b6bdb8faf1ffa7d9c38 |
|
MD5 | feb70c8c9ec939cbf2fb1eff009cbc48 |
|
BLAKE2b-256 | 7992917d955ebb83e5d3045270e6ccdbcc2655f2d8d9c56609af4f67b6178fb2 |