Yolo v4 keras识别(Ubuntu18)
一、darknet测试
下载darknet:
git clone https://github.com/AlexeyAB/darknet.git
进入到darknet目录下进行编译:
测试:若出现以下,说明编译成功。
生成上述视频的命令:
./darknet.exe detector demo ../../cfg/coco.data ../../cfg/yolov4-1024.cfg ../../yolov4.weights ~/Desktop/0002-20170519-2.mp4 -thresh 0.2 -ext_output -out_filename ~/Desktop/output.avi
二、keras识别
下载keras和tensorflow:
这两者的版本要匹配,参考地址
比如Python2.7:
sudo pip3 install keras==2.2.5
sudo pip3 install tensorflow==1.14.
下载Keras源码:
git clone https://github.com/Ma-Dan/keras-yolo4
下载权重文件并保存在keras源码包中:
链接:https://pan.baidu.com/s/1FF79PmRc8BzZk8M_ARdMmw
提取码:dc2j
导入一张图片到keras代码包中,
把这里改为自己的图片名:
使用yolov4_weight.h5:
修改test.py:
运行test.py:
python test.py
使用yolov4_voc_weight.h5:
修改test.py:
运行:
python test.py
参考文献:
https://blog.csdn.net/qq_42451251/article/details/107137508