計算機視覺caffe之路第五篇:關於ssd_detect.cpp的使用方法

1.ssd_detect.py的使用

在caffe/examples/ssd下有很多python版本的目標檢測文件可用:

ssd_detect.py
ssd_pascal_webcam.py
ssd_pascal_video.py

用python方法進行detect比較簡單,但根據目前使用情況來看,速度較慢,在Jetson TX1下,執行

# Forward pass.
detections = net.forward()['detection_out']

這一行需要300~500ms,效果不理想。

2.ssd_detect.cpp的使用

1)按照教程 計算機視覺caffe之路第一篇:Ubuntu16.04_Jetson TX1_Caffe_ssd環境配置配置後,在caffe/.build_release/examples/ssd/目錄下可以找到:

ssd_detect.bin

使用該文件可以進行目標檢測:

// Usage:
//    ssd_detect [FLAGS] model_file weights_file list_file
//
// where model_file is the .prototxt file defining the network architecture, and
// weights_file is the .caffemodel file containing the network parameters, and
// list_file contains a list of image files with the format as follows:
//    folder/img1.JPEG
//    folder/img2.JPEG
// list_file can also contain a list of video files with the format as follows:
//    folder/video1.mp4
//    folder/video2.mp4
  ./build/examples/ssd/ssd_detect.bin \
  models/VGGNet/VOC0712/SSD_300x300/deploy.prototxt \
  models/VGGNet/VOC0712/SSD_300x300/VGG_VOC0712_SSD_300x300_iter_120000.caffemodel \
  examples/videos/test.txt \
  --file_type video \
  --out_file output.txt \
  --confidence_threshold 0.4

2)修改ssd_detect.cpp並編譯:
這裏寫圖片描述



參考文獻:

How to use the ssd_detect.cpp to detect objects in a image
How to compile ssd_detect.cpp

關於ssd_detect.cpp

發佈了37 篇原創文章 · 獲贊 36 · 訪問量 17萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章