Real-Time Object Detection / Segmentation in C++ with YOLO and Onnx Runtime
An example of using Yolo with the Onnx runtime in C++ that
goes along with my blog post on Medium .
ONNX Runtime
OpenCV
Cmake
C++ compiler
CUDA Toolkit / cuDNN (GPU Only)
See the object detection article on Medium for more details.
c++ - Contains the C++ example code for object detection and segmentation using ONNX runtime.
python - Contains the python scripts for converting pytorch weights to ONNX format and object segmentation using ONNX runtime.
images - Contains sample images used in the blog post.
labels - Contains the class names for the YOLO model trained on COCO dataset.
weights - Contains the weights for the YOLO object detection / segmentation model trained on COCO dataset from Ultralytics.
Here is the breakdown of the results of the speed test:
Task
Average Latency (ms)
Pre-processing
6
Inference
6
Bounding Box Post-processing
1
Mask Post-processing
3
Drawing Boxes / Masks
1
Total loop time
20
Python (Not finished yet)
Task
Average Latency (ms)
Pre-processing
Inference
Bounding Box Post-processing
Mask Post-processing
Drawing Boxes / Masks
Total loop time