LoginSignup
14

More than 5 years have passed since last update.

[検出レート約30FPS] RaspberryPi3 Model B(プラスなし) で TX2 "より少し遅い" MobilenetSSDの物体検出レートを獲得しつつ MultiModel (VOC+WIDER FACE) に対応する

Last updated at Posted at 2018-09-01

MobileNet-SSD-RealSense GitHub stars
I wrote an English translation at the end of the article
画像サイズが大きいため、Wi-Fi環境下での閲覧を推奨

◆ 前回記事

Intelさんがまた褒めてくれたヽ(゚∀゚)ノ イエァ RaspberryPi3でMobileNet-SSD(MobileNetSSD)物体検出とRealSense測距(640x480) 再生フレームレート25FPS以上 + 予測レート12FPSを達成したよ

◆ はじめに

オジサンはあきらめが悪いので、ラズパイで更にSSDの検出スピードを上げたくなったわけです。
そして、顔検出の学習モデルを複数同時に使用したくなったのです。
しつこいんです。

使用する部材は USB Camera を除いて前回と同じ。
プログラムを改良し、USB Cameraを見直して高速化。
また、1つのスティックで顔検出などの複数の学習モデルを同時に実行できるように改良。 (MultiModel)
当然、TX2のほうがはるかにパフォーマンスが出るに決まっている。
あくまで、 インタプリタのPython と ラズパイ の組み合わせでこれだけのパフォーマンスが出れば上出来、というレベルで見ていただきたい。

◆ 結果

Playback と表示されている部分は動画の再生レート
Detection と表示されている部分はSSDの検出レート
USB Cameraは、Amazonの中古出品で昨日手配した ¥500PlayStationEye
使用した Neural Compute Stick は4本。
やはり日本製のカメラはすごく良い。
カタログスペックがちゃんと出る。
15倍高価な中華製USBカメラより、10年前にSONYが出荷した骨董品USBカメラのほうが性能が良い、という笑い話。
フレームレート計算の誤差はともかくとして、動画再生は30FPS、検出は24FPS前後出ている。
USB2.0 の転送帯域内に収まるなら、Stickをあと1本増やせば 30FPS 前後出ると思う。
また、USBカメラ側の設定フレームレートを60FPSなどに設定し、Stick本数を更に増やせばもう少しレートは上げられるかもしれない。
が、CPUの処理性能に依存するうえ、それ以上のスピードアップはあまり意味を成さないので興味が沸かない。
一応、知り合いにStickを借りて、Stick 5本まで試そうと思う。
パフォーマンスが上がったらタイトルの [検出レート約xxFPS] を修正する。

2018.09.04 Stick 5本で最高のパフォーマンス、検出レート30FPSを達成。
USBカメラの動画撮影レートを 30FPS から 37FPS へ変更している。

アホ過ぎるトライアルなので、わりと希少な検証かもしれない。

Stick 4本 24FPS の動画
【Github】 https://github.com/PINTO0309/MobileNet-SSD-RealSense
【Youtube動画 生の再生スピード】 https://youtu.be/v-Cei1TW88c
ezgif.com-resize.gifダウンロード.png

Stick 5本 30FPS の動画
暗がりで検証してしまったため、かなりの頻度で間違えたラベルを表示してしまった。
【Github】 https://github.com/PINTO0309/MobileNet-SSD-RealSense
【Youtube動画 生の再生スピード】 https://youtu.be/CL6PTNgWibI
ezgif.com-optimize.gif

PlayStationEye (動画フォーマット:YUYV)

解像度 USB Cameraの有効フレームレート
320x240 187.000, 150.000, 137.000, 125.000, 100.000, 75.000, 60.000, 50.000, 37.000, 30.000
640x480 60.000, 50.000, 40.000, 30.000, 15.000

FaceDetectionモードを有効にすると、Pascal VOCの検出とWIDER FACEの検出を同時に行う。
2モデルを同時に使用するため、当然ながら検出レートは若干下がる。
モード切り替えパラメータにより、SSDを無効にしてFaceDetectionのみを有効にすることも、SSDのみを有効にすることも可能。
使用した Neural Compute Stick は3本。
【Github】 https://github.com/PINTO0309/MobileNet-SSD-RealSense
【Youtube動画 生の再生スピード】 https://youtu.be/fQZpuD8mWok
13.gif

◆ 実装

Github を見てください。
2種類のモデルの実装は Caffe
不覚にも、監視カメラだのなんだので、少しでも使えそうな匂いがしてしまったそこのアナタ。
あわよくば Star :star2: をポチってやってください。

10年前のSONYのカメラ、最高!!!
次はセマンティックセグメンテーションに挑戦してみたい。

◆ 次回記事

RaspberryPi3で複数のMovidius Neural Compute Stick をシームレスにクラスタ切り替えして高速推論性能を維持しつつ熱暴走(内部温度70℃前後)を回避する
 
 
 

[Detection rate approx. 30FPS] RaspberryPi3 Model B(plus none) is slightly later than TX2, acquires object detection rate of MobilenetSSD and corresponds to MultiModel (VOC+WIDER FACE)

◆ Previous article

Intel also praised me again ヽ(゚∀゚)ノ Yeah MobileNet-SSD (MobileNetSSD) object detection and RealSense distance measurement(640x480) with RaspberryPi3 Playback frame rate 25FPS or more + I achieved a predicted rate of 12FPS

◆ Introduction

I will not give it up.
I wanted to raise the detection speed of SSD further in RaspberryPi.
And I wanted to use multiple face detection learning models simultaneously.

The parts used are the same as last time except USB Camera.
Improve program, review USB camera and speed up.
Also improved to allow simultaneous execution of multiple learning models such as face detection with one stick. (MultiModel)
Of course, TX2 has decided to get much better performance.

◆ Result

The part marked "Playback" is the video playback rate.
The part denoted as "Detection" shows the SSD detection rate.
USB Camera was purchased yesterday for Amazon's second-hand exhibition, $5 "PlayStationEye".
Four Neural Compute Sticks used.
After all the Japanese made camera is very good.
The catalog specifications are properly displayed.
A funny story that an antique USB camera shipped by SONY 10 years ago has better performance than a 15 times expensive Chinese-made USB camera.
Regardless of the error of the frame rate calculation, 30FPS for motion picture playback and 24FPS for detection are coming out.
If it fits within the transfer band of USB 2.0, I think that if you add 1 more Stick, it will get around 30FPS.
Also, if you set the setting frame rate on the USB camera side to 60 FPS etc. and further increase the number of Sticks you may be able to raise the rate a little more.
However, depending on the processing performance of the CPU, further speedup does not make much sense, so it is not interesting.
I think I will borrow a stick from acquaintances and try up to five sticks.
When performance gets better, correct the [Detection rate approx. xxFPS] of the title.

4 Sticks 24FPS
【Github】 https://github.com/PINTO0309/MobileNet-SSD-RealSense
【Youtube Movie Raw play speed】 https://youtu.be/v-Cei1TW88c
ezgif.com-resize.gifダウンロード.png

5 Sticks 30FPS
【Github】 https://github.com/PINTO0309/MobileNet-SSD-RealSense
【Youtube Movie Raw play speed】 https://youtu.be/CL6PTNgWibI
ezgif.com-optimize.gif

PlayStationEye (Movie format:YUYV)

Resolution Effective frame rate of USB Camera
320x240 187.000, 150.000, 137.000, 125.000, 100.000, 75.000, 60.000, 50.000, 37.000, 30.000
640x480 60.000, 50.000, 40.000, 30.000, 15.000

When FaceDetection mode is enabled, detection of Pascal VOC and detection of WIDER FACE are performed at the same time.
Since two models are used at the same time, the detection rate is naturally lowered slightly.
Depending on the mode switching parameter, you can disable SSD and enable only FaceDetection or only SSD.
I used three Neural Compute Sticks.
【Github】 https://github.com/PINTO0309/MobileNet-SSD-RealSense
【Youtube Movie Raw play speed】 https://youtu.be/fQZpuD8mWok
13.gif

◆ Implementation

Github
Implementation of two types of models is Caffe

The camera of SONY ten years ago, Excellent!!!
Next challenge semantic segmentation.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14