EnoxSoftware / OpenCVForUnity

OpenCV for Unity (Untiy Asset Plugin)
https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088
550 stars 172 forks source link

YOLOv8 support #177

Open tv-gc opened 7 months ago

tv-gc commented 7 months ago

Hi!

I would like to ask if OpenCVForUnity will support YOLO version 8 and if so, when will the example be shared?

Cheers!

dragan07-07 commented 7 months ago

it is already supported!

tv-gc commented 7 months ago

Oh really? I thought you had to make predictors and detectors for it because YoloV5 is on a different repository.

Is there references on how to use v8 that you could share?

Thanks!

EnoxSoftware commented 7 months ago

Sorry for the delay in responding. It seems that opencv's dnn module is capable of inferring yolov8 models in onnx format. https://github.com/opencv/opencv/pull/24611

We have a YOLOv5 example repository on our OpenCVForUnity GitHub, but that example is not applicable to yolov8 models. The data structure of the inference results is different between yolov5 and yolov8, so you need to implement yolov8-specific code. We have created a new repository containing examples of yolov8 object detection models. Please try it out. https://github.com/EnoxSoftware/YOLOv8WithOpenCVForUnityExample

EnoxSoftware commented 7 months ago

Examples of Segmentation and Classification models have also been added!

dragan07-07 commented 6 months ago

Tnx it is very useful!

wimvanhenden-tool commented 6 months ago

It seems when using CUDA backend with dnn, the returned bounding boxes are all 0. Using inference on CPU works fine. That seems to be an OpenCV 4.2.8 problem.

EnoxSoftware commented 6 months ago

@wimvanhenden-tool This problem seems to have been reported in the opencv repository. https://github.com/opencv/opencv/issues/23977