UNeedCryDear / yolov8-opencv-onnxruntime-cpp

yolov8 hub,cpp with onnxruntime and opencv
Apache License 2.0
282 stars 53 forks source link

onnx example #41

Open YanhaoZhang opened 5 months ago

YanhaoZhang commented 5 months ago

Hi Thanks a lot for releasing the code. I am quite new to using onnx for yolov8 segmentation. I was wondering if you could please provide the onnx file as an example. For example yolov8s-seg.onnx. Thanks a lot.

YanhaoZhang commented 5 months ago

Btw, I find a but here: It should be bool CheckModelPath(const std::string & modelPath);

UNeedCryDear commented 5 months ago
  1. You can export it yourself:
    
    # for opencv dnn:
    yolo export model=path/to/yolov8s-seg.pt format=onnx dynamic=False  opset=12
    # for onnxruntime:
    yolo export model=path/to/yolov8s-seg.pt format=onnx  dynamic=False/True   #dynamic=True or False 

2. The parameters of CheckModelPath() have little impact and can be referenced or not.