Skip to content

Run darknet Yolo3

Kewei Yan edited this page Feb 15, 2023 · 9 revisions

Build

Before make, please go to check Makefile to make sure that the path for loading libraries such as CUDA, cuDNN, openCV are matching your machine, especially for opencv, now the package name may need to be changed to opencv4

git clone https://github.com/pjreddie/darknet.git
cd darknet
make

Run

./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

cuDNN 8.0+ *_SPECIFY_LIMIT can not be recognized bug

If you are using cuDNN 8.0+, please go to the following link to handle the CUDNN_MAJOR. You need to replace the src/convolutional_layer.c with the one you can find there.

IplImage bug

go to src/image_opencv.cpp, add these headers:

#include "opencv2/core/core_c.h"
#include "opencv2/videoio/legacy/constants_c.h"
#include "opencv2/highgui/highgui_c.h"

Also, go to line 67, replace line 67 with:

IplImage ipl = cvIplImage(m);

opencv.pc not find bug

Re-build openCV with -DOPENCV_GENERATE_PKGCONFIG=YES, also, add /usr/local/lib/pkgconfig to PKG_CONFIG_PATH.

window.cpp function not implemented bug

install gtk2.0 before installing openCV