Skip to content

Deploy YOLOv5 Segmentation on ONNXRUNTIME or OpenCV DNN [WITHOUT PYTORCH]

Notifications You must be signed in to change notification settings

Hyuto/yolov5-seg-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLOv5 Segmentation Python

horse


Run yolov5 segmentation model on onnxruntime or opencv dnn without torch!

Usage

All you need is on segment.py, it provides cli to run yolov5-seg onnx model.

python segment.py -- help

Image

zidane bus
python segment.py -m <YOLOV5-SEG-ONNX-PATH> -i <IMAGE-PATH>

Video

horse street
python segment.py -m <YOLOV5-SEG-ONNX-PATH> -v 0            # webcam
                                               <VIDEO-PATH> # local video

Note : Press q to stop video processing.

OpenCV DNN

Use Opencv DNN as backend with --dnn arguments.

python segment.py -m <YOLOV5-SEG-ONNX-PATH> -v 0 --dnn

Run on GPU

Auto using gpu to run model when devices is supported.

  • onnxruntime need onnxruntime-gpu to be installed.

    Note : onnxruntime-gpu must be installed with the same version as onnxruntime to be able to use GPU.

  • opencv-dnn need custom build.

pip install onnxruntime-gpu==<YOUR-ONNXRUNTIME-VERSION>

Reference

About

Deploy YOLOv5 Segmentation on ONNXRUNTIME or OpenCV DNN [WITHOUT PYTORCH]

Topics

Resources

Stars

Watchers

Forks

Languages