Run yolov5 segmentation model on onnxruntime or opencv dnn without torch!
All you need is on segment.py, it provides cli to run yolov5-seg onnx model.
python segment.py -- help![]() |
![]() |
python segment.py -m <YOLOV5-SEG-ONNX-PATH> -i <IMAGE-PATH>![]() |
![]() |
python segment.py -m <YOLOV5-SEG-ONNX-PATH> -v 0 # webcam
<VIDEO-PATH> # local videoNote : Press q to stop video processing.
Use Opencv DNN as backend with --dnn arguments.
python segment.py -m <YOLOV5-SEG-ONNX-PATH> -v 0 --dnnAuto using gpu to run model when devices is supported.
-
onnxruntimeneedonnxruntime-gputo be installed.Note :
onnxruntime-gpumust be installed with the same version asonnxruntimeto be able to use GPU. -
opencv-dnnneed custom build.
pip install onnxruntime-gpu==<YOUR-ONNXRUNTIME-VERSION>



