yolo4+visdrone2020数据集
和上一篇yolov3的流程差不多,只是更改yolo的cfg文件和预训练的权重不同,将操作移至./darknet/build/x64文件夹内,将./darknet/下的darknet执行文件复制到./darknet/build/x64/下
cfg主要更改
1. 分辨率为416*416,如果你的显卡内存不足可以调整subdivisions,减少每次放入内存图片的数量
2. max_batches=20000(class的2000倍,class=10), steps= 16000,18000(max_batches的80%和90%)
3. [yolo] 部分,修改class=10,filters = 45 ((class+5)*3)
预训练权重可在官方github上下载
yolov4.cfg -> yolov4.conv.137(预训练权重)
yolov4-tiny.cfg --> yolov4-tiny.conv.29
训练
./darknet detector train data/voc-custom.data cfg/yolov4-custom-visdrone.cfg yolov4.conv.137 2>&1 | tee visualization/train_yolov4.log #yolov4.cfg,
./darknet detector train data/voc.data cfg/yolov4-tiny-visdrone.cfg yolov4-tiny.conv.29 2>&1 | tee visualization/train_yolov4.log #yolov4-tiny.cfg,
暂停后继续训练(将backup文件夹下的yolov4-***_last.weights复制到x64文件夹下)
./darknet detector train data/voc.data cfg/yolov4-tiny-visdrone.cfg yolov4-tiny-visdrone_last.weights 2>&1 | tee visualization/train_yolov4.log
./darknet detector train data/voc.data cfg/yolov4-visdrone.cfg yolov4-custom-visdrone_last.weights 2>&1 | tee visualization/train_yolov4.log
测试视频
./darknet detector demo data/voc-custom.data cfg/yolov4-custom-visdrone.cfg yolov4-custom-visdrone_last.weights -ext_output cardemo.mp4