AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.8k stars 7.97k forks source link

Support with OpenCV dnn module for Yolov4 model. #5671

Open akshayjaryal603 opened 4 years ago

akshayjaryal603 commented 4 years ago

I tried to run the code using dnn module in OpenCV but I got error mish activation function is not supported. Can you please help me to solve this issue?

Thanks, @AlexeyAB

AlexeyAB commented 4 years ago

Wait for new OpenCV release or use OpenCV-master-branch: https://github.com/opencv/opencv

HYL-Dave commented 4 years ago

If you want to use dnn module in OpenCV to run yolov4, you can complie the source code (checkout master). I have tried, it works.

Hiwyl commented 4 years ago

如果要在OpenCV中使用dnn模块运行yolov4,则可以编译源代码(检出母版)。我试过了,行得通。 Hi! I ’m just a little white, can you tell me more.thankyou

akhilgkrishnan commented 4 years ago

Hey @AlexeyAB , Its not working after checkout with master. Showing the same problem

AlexeyAB commented 4 years ago

Use branch opencv:3.4 until new OpenCV will be released https://github.com/opencv/opencv/pull/17185

akhilgkrishnan commented 4 years ago

Hey @AlexeyAB , it again showing below error

cv2.error: OpenCV(3.4.10-dev) /home/akhil/opencv_build/opencv-3.4/modules/dnn/src/darknet/darknet_io.cpp:864: error: (-213:The function/feature is not implemented) Transpose the weights (except for convolutional) is not implemented in function 'ReadDarknetFromWeightsStream'

AlexeyAB commented 4 years ago

https://github.com/opencv/opencv/archive/3.4.zip

akhilgkrishnan commented 4 years ago

yes I used the same file @AlexeyAB. But showing the above error.

akhilgkrishnan commented 4 years ago

Hey @AlexeyAB , How to solve this..

AlexeyAB commented 4 years ago
Krishnaprasad-R commented 4 years ago

Hi, I have used the code using cv2.dnn(...) for loading the weights in yolov3 python. How to use this link https://github.com/opencv/opencv/archive/3.4.zip to fix the cv2.dnn() loading error for yolov4?

aswin-datakalp commented 4 years ago

Using https://github.com/opencv/opencv/pull/17185#issue-410624326

When i build opencv(3.4.10 - clone repo and checked out to 3.4.10 branch) from scratch and tried running :

import cv2 net = cv2.dnn_DetectionModel(yolov4.cfg', 'yolov4.weights)

It throws "cv2.cv2 has no module "dnn_DetectionModel" "

Screenshot from 2020-06-16 17-05-19

Kindly provide some support @AlexeyAB , @HYL-Dave , @I-bat

akshayjaryal603 commented 4 years ago

Same issue I am also facing when I compile the specified version of OpenCV. Help Needed @AlexeyAB !

lsg945 commented 4 years ago

@akshayjaryal603 https://pullrequest.opencv.org/buildbot/export/opencv_releases/3_4_pack-android/ with this version https://pullrequest.opencv.org/buildbot/export/opencv_releases/3_4_pack-android/20200624-022839--785/ of today and I didn't got issues

lsg945 commented 4 years ago

But if you want build it, you have to clone this branch: https://github.com/opencv/opencv/tree/3.4

paulbroadmission commented 4 years ago

the same issue here

AlexeyAB commented 4 years ago

https://github.com/opencv/opencv/archive/master.zip

snehitvaddi commented 4 years ago

Does OpenCV support YoloV4?? If yes, which version of OpenCV is compatible.

akshayjaryal603 commented 4 years ago

Yes, @snehitvaddi Opencv 4.4.0 support YoloV4.