注:本文参考:https://pjreddie.com/darknet/yolo/
1.YOLO有专有的深度学习网络darknet,下载并编译
git clone https://github.com/pjreddie/darknet.git
cd darknet
make
编译没有问题的话输出信息如下:
mkdir -p obj
gcc -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Ofast....
gcc -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Ofast....
gcc -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Ofast....
.....
gcc -I/usr/local/cuda/include/ -Wall -Wfatal-errors -Ofast -lm....
编译好之后运行
./darknet
2.GPU与Opencv的使用
打开 Makefile文件修改如下:
GPU=1
CUDNN=0
OPENCV=1
OPENMP=0
DEBUG=0
3.下载权重参数
wget https://pjreddie.com/media/files/yolov3.weights
4.运行
./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg
5.效果如下:
6.摄像头画面分类
./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights