一、darknet框架配置
github网址
https://github.com/pjreddie/darknet
Linux终端操作
git clone https://github.com/pjreddie/darknet
cd darknet
make
在windows操作系统上跑YOLO可以使用cygwin
下载预训练权重
wget https://pjreddie.com/media/files/yolov3.weights
使用data文件夹下的dog.jpg文件测试
./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg
终端输出:
layer filters size input output
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BFLOPs
1 conv 64 3 x 3 / 2 416 x 416 x 32 -> 208 x 208 x 64 1.595 BFLOPs
.......
105 conv 255 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 255 0.353 BFLOPs
106 detection
truth_thresh: Using default '1.000000'
Loading weights from yolov3.weights...Done!
data/dog.jpg: Predicted in 0.029329 seconds.
dog: 99%
truck: 93%
bicycle: 99%
darknet文件夹下会产生“prediction.jpg”:
注意上面的命令是下面的命令的缩写:
./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/dog.jpg
命令中也可以先不写图片的路径,会产生如下的输出:
./darknet detect cfg/yolov3.cfg yolov3.weights
layer filters size input output
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BFLOPs
1 conv 64 3 x 3 / 2 416 x 416 x 32 -&g