Cannot object detection for cv2.dnn.readNetFromDarknet inside Opencv python

Viewed 1563

I am working object detection with opencv python.

My plan is below.
1. Train my own object (1 class) with darknet.
2. Make object detection code with opencv-python using cv2.dnn.readNetFromDarknet function.

I made success for step1.
I trained my own object (1 class) with darknet (VS2015) and I got weights, cfg, and names file.
(I think train well because current avg loss is 0.015 and Region Avg IOU is 0.92)
Also, I checked train model with test image in darknet.

But in step2, my model can't detect anything with same test image in opencv-python.
I checked original coco dataset weights which is downloaded from darknet, and my code is working for detection such as person, car ...
It is not working on my model.
I can't guess what is happened and issue.

I need your help.

My system is below.

Windows10 64bit
cuda 10.0
cudnn 7.6.5
python 3.7.7
tensorflow 2.0.0
opencv-python 4.2.0.34

Many thanks.

My code is refered to https://pysource.com/2019/06/27/yolo-object-detection-using-opencv-with-python/.

0 Answers
Related