opencv_dnn:samples:object_detection

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
opencv_dnn:object_detection [2018/09/18 11:08] – [Yolo] babaopencv_dnn:samples:object_detection [2019/07/30 09:53] (現在) – ↷ opencv_dnn:object_detection から opencv_dnn:samples:object_detection へページを移動しました。 baba
行 1: 行 1:
 +{{indexmenu_n>3}}
 ====== Object Detection ====== ====== Object Detection ======
-[[opencv_dnn:install|OpenCVでDNN]]にてできあがった実行ファイルである,example_dnn_object_detectionを利用します.実行に先立ち,ネットワークの設定ファイル,+[[opencv_dnn:環境構築:install|OpenCVでDNN]]にてできあがった実行ファイルである,example_dnn_object_detectionを利用します.実行に先立ち,ネットワークの設定ファイル,
 重みファイル,クラス名一覧を記したファイルが必要になります.まずは下記を参照してください. 重みファイル,クラス名一覧を記したファイルが必要になります.まずは下記を参照してください.
  
行 17: 行 18:
     * configファイル: MobileNetSSD_deploy.prototxt     * configファイル: MobileNetSSD_deploy.prototxt
     * classesファイル:{{ :opencv_dnn:names-voc.txt |}}     * classesファイル:{{ :opencv_dnn:names-voc.txt |}}
 +    * 実行時間:65.18[ms]
 +    * {{:opencv_dnn:スクリーンショット_2018-09-18_12.34.14.png?400|}}
  
 ダウンロードが済んだら,下記を実行して動作を確かめてみます. ダウンロードが済んだら,下記を実行して動作を確かめてみます.
-  $ ./example_dnn_object_detection --config=MobileNetSSD_deploy.prototxt --model=MobileNetSSD_deploy.caffemodel --width=300 --height=300 --scale=0.00784+  $ ./example_dnn_object_detection --config=MobileNetSSD_deploy.prototxt --model=MobileNetSSD_deploy.caffemodel --width=300 --height=300 --scale=0.00784 --input=dog.jpg
      
-カメラ起動し前の自分がpersonして識別されていればOKです.+カメラ起動したい場合はinputオプションを消す,デフォルトカメラ起動します.
  
 ===== SSDs from TensorFlow ===== ===== SSDs from TensorFlow =====
行 35: 行 38:
 ダウンロード後展開し,その中にある frozen_inference_graph.pb をmodelファイルとして指定します.configファイルには,解凍したファイルからpbtxtを生成するのが正しいやり方になります. ダウンロード後展開し,その中にある frozen_inference_graph.pb をmodelファイルとして指定します.configファイルには,解凍したファイルからpbtxtを生成するのが正しいやり方になります.
   * {{ :opencv_dnn:ssd_mobilenet_v1_coco_2017_11_17.pbtxt |}}   * {{ :opencv_dnn:ssd_mobilenet_v1_coco_2017_11_17.pbtxt |}}
 +  * 実行時間:63.86[ms]
 +  * {{:opencv_dnn:スクリーンショット_2018-09-18_12.32.49.png?400|}}
  
-  $ ./example_dnn_object_detection  --config=ssd_mobilenet_v1/ssd_mobilenet_v1_coco_2017_11_17.pbtxt  --model=ssd_mobilenet_v1/frozen_inference_graph.pb  --classes=names.txt  --width=300 --height=300 --scale=1.0 --rgb+  $ ./example_dnn_object_detection  --config=ssd_mobilenet_v1/ssd_mobilenet_v1_coco_2017_11_17.pbtxt  --model=ssd_mobilenet_v1/frozen_inference_graph.pb  --classes=names.txt  --width=300 --height=300 --scale=1.0 --rgb --input=dog.jpg
      
 ==== ssd_mobilenet_v2_coco ==== ==== ssd_mobilenet_v2_coco ====
行 43: 行 48:
 上記同様に froen_inference_graph.pb をmodelファイル,configファイルには生成したpbtxtを使う.ここでは生成したファイルをはっつけます. 上記同様に froen_inference_graph.pb をmodelファイル,configファイルには生成したpbtxtを使う.ここでは生成したファイルをはっつけます.
   * {{ :opencv_dnn:ssd_mobilenet_v2_coco_2018_03_29.pbtxt |}}   * {{ :opencv_dnn:ssd_mobilenet_v2_coco_2018_03_29.pbtxt |}}
 +  * 実行時間:91.83[ms]
 +  * {{:opencv_dnn:スクリーンショット_2018-09-18_12.31.35.png?400|}}
  
- $ ./example_dnn_object_detection  --config=ssd_mobilenet_v2/ssd_mobilenet_v2_coco_2018_03_29.pbtxt  --model=ssd_mobilenet_v1/frozen_inference_graph.pb  --classes=names.txt  --width=300 --height=300 --scale=1.0 --rgb+  $ ./example_dnn_object_detection  --config=ssd_mobilenet_v2/ssd_mobilenet_v2_coco_2018_03_29.pbtxt  --model=ssd_mobilenet_v2/frozen_inference_graph.pb  --classes=names.txt  --width=300 --height=300 --scale=1.0 --rgb --input=dog.jpg
 ===== SSD from Caffe ===== ===== SSD from Caffe =====
 MobileNetではなく,元々のオリジナルSSDのcaffe実装.まずは下記リンクから一式ダウンロードし,必要なモデル,configファイルを持ってくる. MobileNetではなく,元々のオリジナルSSDのcaffe実装.まずは下記リンクから一式ダウンロードし,必要なモデル,configファイルを持ってくる.
   * https://drive.google.com/file/d/0BzKzrI_SkD1_dUY1Ml9GRTFpUWc/view   * https://drive.google.com/file/d/0BzKzrI_SkD1_dUY1Ml9GRTFpUWc/view
 +  * 実行時間:1197.79[ms]
 +  * {{:opencv_dnn:スクリーンショット_2018-09-18_12.11.35.png?400|}}
  
-  $ ./example_dnn_object_detection  --config=deploy.prototxt  --model=VGG_coco_SSD_300x300_iter_400000.caffemodel  --classes=names.txt  --width=300 --height=300 --scale=1.0 +  $ ./example_dnn_object_detection  --config=deploy.prototxt  --model=VGG_coco_SSD_300x300_iter_400000.caffemodel  --classes=names.txt  --width=300 --height=300 --scale=1.0 --input=dog.jpg
 ===== Yolo ===== ===== Yolo =====
 動作速度が高速であり,SSDとobject detectionにおいて双璧をなすアルゴリズムです.高速動作と引き換えにmAP(mean Average Percentage)がやや低め(バウンディングボックス精度が低い)というデメリットがあります.適応するアプリケーションがバウンディングボックスの正確性を必要とするものであれば不向きですが,ある程度この辺になにがあるかをざっくり知るだけであれば,本手法がおすすめです. 動作速度が高速であり,SSDとobject detectionにおいて双璧をなすアルゴリズムです.高速動作と引き換えにmAP(mean Average Percentage)がやや低め(バウンディングボックス精度が低い)というデメリットがあります.適応するアプリケーションがバウンディングボックスの正確性を必要とするものであれば不向きですが,ある程度この辺になにがあるかをざっくり知るだけであれば,本手法がおすすめです.
 +  * 実行時間:94.38[ms]
 +  * {{:opencv_dnn:スクリーンショット_2018-09-18_12.09.36.png?400|}}
  
 +
 +  $ ./example_dnn_object_detection --classes=names.txt --config=yolov2-tiny.cfg --model=yolov2-tiny.weights --height=416 --width=416 --scale=0.00392 --input=dog.jpg
 +  
  • /home/users/2/lolipop.jp-4404d470cd64c603/web/ws/data/attic/opencv_dnn/samples/object_detection.1537236512.txt.gz
  • 最終更新: 2018/09/18 11:08
  • by baba