1.直接设置使用,编译通过
git clone https://github.com/pjreddie/darknet.git cd darknet make
2. 下载权重测试
wget http://pjreddie.com/media/files/yolo.weights ./darknet yolo test cfg/yolo.cfg yolo.weights data/dog.jpg
3.测试结果:
dsp@dsp:/media/dsp/学习/yolo_darknet/darknet$ ./darknet yolo test cfg/yolo.cfg yolo.weights data/dog.jpg layer filters size input output 0 conv 32 3 x 3 / 1 608 x 608 x 3 -> 608 x 608 x 32 1 max 2 x 2 / 2 608 x 608 x 32 -> 304 x 304 x 32 2 conv 64 3 x 3 / 1 304 x 304 x 32 -> 304 x 304 x 64 3 max 2 x 2 / 2 304 x 304 x 64 -> 152 x 152 x 64 4 conv 128 3 x 3 / 1 152 x 152 x 64 -> 152 x 152 x 128 5 conv 64 1 x 1 / 1 152 x 152 x 128 -> 152 x 152 x 64 6 conv 128 3 x 3 / 1 152 x 152 x 64 -> 152 x 152 x 128 7 max 2 x 2 / 2 152 x 152 x 128 -> 76 x 76 x 128 8 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256 9 conv 128 1 x 1 / 1 76 x 76 x 256 -> 76 x 76 x 128 10 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256 11 max 2 x 2 / 2 76 x 76 x 256 -> 38 x 38 x 256 12 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512 13 conv 256 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 256 14 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512 15 conv 256 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 256 16 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512 17 max 2 x 2 / 2 38 x 38 x 512 -> 19 x 19 x 512 18 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024 19 conv 512 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 512 20 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024 21 conv 512 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 512 22 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024 23 conv 1024 3 x 3 / 1 19 x 19 x1024 -> 19 x 19 x1024 24 conv 1024 3 x 3 / 1 19 x 19 x1024 -> 19 x 19 x1024 25 route 16 26 conv 64 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 64 27 reorg / 2 38 x 38 x 64 -> 19 x 19 x 256 28 route 27 24 29 conv 1024 3 x 3 / 1 19 x 19 x1280 -> 19 x 19 x1024 30 conv 425 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 425 31 detection mask_scale: Using default ‘1.000000‘ Loading weights from yolo.weights...Done! data/dog.jpg: Predicted in 9.566333 seconds. Not compiled with OpenCV, saving to predictions.png instead
- 区分上下连个命令:
./darknet yolo test cfg/yolo.cfg yolo.weights data/dog.jpg
./darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg
-/darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg 结果:
4.设置GPU和opencv
GPU=1 OPENCV=1
-编译错误
/usr/bin/ld: cannot find -lippicv collect2: error: ld returned 1 exit status Makefile:76: recipe for target ‘darknet‘ failed make: *** [darknet] Error 1 /usr/bin/ld: cannot find -make: *** Waiting for unfinished jobs.... lippicv collect2: error: ld returned 1 exit status Makefile:82: recipe for target ‘libdarknet.so‘ failed make: *** [libdarknet.so] Error 1