Requirements have been installed Cuda 8.0 and OpenCV3.1.0
YOLO Official website
Configure Darknet
git clone https://github.com/pjreddie/darknet cd darknet make
If there is no error input
./darknet
Get output
./darknet <function>
Description Darknet Configuration Succeeded
Open the Makefile file and change the beginning lines to
gpu=1CUDNN=1OPENCV=1
Then query your GPU's computing power to see if Makefile is included, as follows my GPU computing power is 6.1, adjusted to:
Arch=-gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode Arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_61,code=[sm_61,compute_61] -gencode arch=compute_52,code=[sm_52,compute_52]
After recompiling, you can implement CUDA-and OpenCV-based compilation
download pre-training files
wget https://pjreddie.com/media/files/yolo.weights
Test
./darknet Detect Cfg/yolo.cfg yolo.weights data/dog.jpg
The result I get is:
Layer Filters Size Input Output0Conv + 3X3/1 608X608X3-608X608X + 1Max2X2/2 608X608X +-304X304X + 2Conv - 3X3/1 304X304X +-304X304X - 3Max2X2/2 304X304X -- theX theX - 4Conv - 3X3/1 theX theX -- theX theX - 5Conv - 1X1/1 theX theX -- theX theX - 6Conv - 3X3/1 theX theX -- theX theX - 7Max2X2/2 theX theX -- theX theX - 8Conv the 3X3/1 theX theX -- theX theX the 9Conv - 1X1/1 theX theX the- theX theX - TenConv the 3X3/1 theX theX -- theX theX the OneMax2X2/2 theX theX the- -X -X the AConv + 3X3/1 -X -X the- -X -X + -Conv the 1X1/1 -X -X +- -X -X the -Conv + 3X3/1 -X -X the- -X -X + theConv the 1X1/1 -X -X +- -X -X the -Conv + 3X3/1 -X -X the- -X -X + -Max2X2/2 -X -X +- +X +X + -Conv1024x768 3X3/1 +X +X +- +X +x1024 +Conv + 1X1/1 +X +x1024 +X +X + -Conv1024x768 3X3/1 +X +X +- +X +x1024 +Conv + 1X1/1 +X +x1024 +X +X + AConv1024x768 3X3/1 +X +X +- +X +x1024 atConv1024x768 3X3/1 +X +x1024 +X +x1024 -Conv1024x768 3X3/1 +X +x1024 +X +x1024 -Route - -Conv - 1X1/1 -X -X +- -X -X - -Reorg/2 -X -X -- +X +X the -Route - - inConv1024x768 3X3/1 +X +x1280 +X +x1024 -Conv425 1X1/1 +X +x1024 +X +X425 todetectionmask_scale:usingdefault '1.000000'Loading Weights fromYolo.weights ... done!Data/dog.jpg:predictedinch 0.070790Seconds.dog: the%Car: -%Truck: $%Bicycle: -%Init do opengl support available
Configuration YOLO2 (ubuntu16.04+cuda8.0+opencv3.1.0)