Search code examples
c++opencvdarknetyolo

OpenCv: Using Yolov3


I used the OpenCV Code from https://docs.opencv.org/3.4.1/da/d9d/tutorial_dnn_yolo.html and made it work on my machine with the yolov2 config/weights. When I try to run the program with yolov3 config/weights (https://pjreddie.com/media/files/yolov3.weights, https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg. both working, when used in ubuntu / not in opencv), it fails on the line

dnn::Net net = readNetFromDarknet(modelConfiguration, modelBinary);

The Exception is:

Unhandled exception at 0xyz in xyz.exe: Microsoft C++ exception: cv::Exception at memory location 0xyz.

The expected behavior would be, that it shows the recognition results, like it does with the yolov2 cfg/weights.

Is yolov3 even usable in opencv?

Thanks, Michel


Update: Question was answered below. I made a issue in github: https://github.com/opencv/opencv/issues/11310


Update v2: yolov3 is now supported in opencv. -> https://github.com/opencv/opencv/issues/11310 includes an example of the usage


Solution

  • Only Yolo v2 is supported as of 2018/04/11, see the corresponding pull request.