还是建议先看英文,翻译过来是真的不准
官网: https://pjreddie.com/darknet/yolo/
Github: https://github.com/pjreddie/darknet.git
安装
git clone https://github.com/pjreddie/darknet.git
安装yolo权重:wget https://pjreddie.com/media/files/yolov3-tiny.weights
依赖
cuda
cudnn
opencv
安装opencv-python 是不能出来图像的
apt安装,安装这个就行了
sudo apt install libopencv-devv
源码安装
安装官网:https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html
资源官网:https://opencv.org/releases
1. 依赖cmake g++ wget unzip
sudo apt update && sudo apt install -y cmake g++ wget unzip
2. 下载资源
3. 创建文件夹
mkdir -p build && cd build
3. 编译
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_GENERATE_PKGCONFIG=ON ..
make -j8
5. 安装(英语不好,看起来好吃力)
也说不清楚,将什么哪些文件放在/usr/local。用参数也说不说清楚
这段话说的是啥意思呢?就是在最后一步安装的时候,可以提前将文件()放在/usr/local 目录下,或者用命令确定安装路径
sudo make install
6. 检查是否成功
配置
共三处 nvcc/ ifeq cuda / 开头
将nvcc修改成实际需要的cuda中nvcc,在/usr/local/cuda/bin 目录下
使用CPU加速
使用GPU加速
官网只是说,在Makefile文件中,修改GPU=1就行
但是,不行啊。
修改cuda的地址
nproc查看有几个线程,make -j8编译
测试
可能是yolov3,根据自己情况去文件夹查看
cfg和权重文件一定要对应上
./darknet detect cfg/yolo3-tiny.cfg yolo3-tiny.weight data/dog.jpg