最轻的YOLO算法出来了!这是个模型很是小、号称目前最快的YOLO算法——大小只有1.3MB,单核每秒148帧,移动设备上也能轻易部署。并且,这个YOLO-Fastest算法知足全部平台的须要。不管是PyTorch,仍是Tensorflow,又或者是Keras和Caffe,能够说是全平台通用。此外,做者还推出了超轻YOLO的“加大版”,一样只须要3.5MB,就能实现比YOLOv3更好的目标检测效果。那么,这么轻的网络,检测效果怎么样?node

一、模型编译、测试和训练
1.一、YOLO-Fastest编译
-
第一步:
git clone https://github.com/dog-qiuqiu/Yolo-Fastest
-
第二步:
下载安装opencv:https://github.com/opencv/opencv/releases/tag/4.4.0
-
第三步:
打开cmake,选择Yolo-Fastest
文件夹为source code
路径,Yolo-Fastest
文件夹为目标文件夹;而后点击configure
,再选择opencv.exe
解压缩后的build
文件夹为OPENCV_DIR
的路径;

-
第四步:
打开Visual Studio2017
(具体根据你在configure时选择的编译环境,最好选择2017),选择release
,而后生成解决方案
;

-
第五步
编译完成后在Yolo-Fastest
目录下会有Release
文件夹,把里面编译完成的darknet.dll和darknet.exe
复制到Yolo-Fastest/build/darknet/x64
目录下; -
第六步
把Yolo-Fastest
目录下的除README.MD
之外的4个文件复制到Yolo-Fastest/build/darknet/x64/cfg
目录下;

1.二、YOLO-Fastest视频和图片测试
-
一、 视频测试
输入以下指令既可测试视频检测并输出检测的结果,CPU检测能够达到14FPS/s,比同等条件下使用GPU检测的YOLO-V4快不少:
./darknet detector demo ./cfg/voc.data ./cfg/yolo-fastest.cfg ./cfg/yolo-fastest.weights ./data/test_car.mp4 -i 1 -thresh 0.25 -out_filename ./data/car_output.mp4
注意,测试视频能够为任意你本身想检测的视频文件,这里小编只用了手上有的视频进行了测试git
-
二、 图片测试
输入以下指令既可测试视频检测并输出检测的结果,CPU检测用时为 :
./darknet detector test ./cfg/voc.data ./cfg/yolo-fastest.cfg ./cfg/yolo-fastest.weights ./data/person.jpg -i 1 -thresh 0.25 -out_filename ./data/person_output.jpg


二、YOLO-Fastest训练
-
一、 根据voc数据集的形式标注本身的数据集;github
-
2 、生成一个预先训练好的模型,用于初始化模型主干:web
./darknet partial yolo-fastest.cfg yolo-fastest.weights yolo-fastest.conv.109 109
-
3 、Train:
./darknet partial yolo-fastest.cfg yolo-fastest.weights yolo-fastest.conv.109 109
如下是原做者所获得的结果算法
References
[1] https://github.com/dog-qiuqiu/Yolo-Fastest
[2] https://github.com/AlexeyAB/darknet微信
本文分享自微信公众号 - 计算机视觉CV(jsjsjcv)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。网络