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