1. 程式人生 > >在Ubuntu 16.04下的YOLO V3復現及問題解決

在Ubuntu 16.04下的YOLO V3復現及問題解決

在使用yolo應用於自己的專案時,首先復現一下作者所做的,看一下效果。

主要參考:https://pjreddie.com/darknet/yolo/

使用預訓練模型進行檢測

本文將引導您使用預先訓練的模型通過YOLO系統檢測物件。 如果你還沒有安裝Darknet,你應該先安裝一下。

git clone https://github.com/pjreddie/darknet
cd darknet
make

(沒問題,等待安裝即可)

您已經在cfg /子目錄中擁有YOLO的配置檔案。 您必須在此下載預先訓練的體重檔案(237 MB)。 或者只是執行這個:

wget https://pjreddie.com/media/files/yolov3.weights

然後執行檢測器!

./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

(此時出現問題,並沒有出現預期結果)

在執行檢測器時,出現 bash: ./darknet:is a diratory 錯誤,所以改為在darknet目錄下生成一個Terminal輸入,執行成功,但是沒有成功載入權重檔案,

yolov3.weights,接下來將此權重檔案放入darknet目錄下,即可成功得到預期結果,所生成的檔案在darknet資料夾下:

layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   416 x 416 x   3   ->   416 x 416 x  32  0.299 BFLOPs
    1 conv     64  3 x 3 / 2   416 x 416 x  32   ->   208 x 208 x  64  1.595 BFLOPs
    .......
  105 conv    255  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 255  0.353 BFLOPs
  106 detection
truth_thresh: Using default '1.000000'
Loading weights from yolov3.weights...Done!
data/dog.jpg: Predicted in 0.029329 seconds.
dog: 99%
truck: 93%
bicycle: 99%