YoloV2 より超速 MobileNetSSD+Neural Compute Stick(NCS)+Raspberry Piによる爆速・高精度の複数動体検知
映像再生と物体検出は非同期実行。
マルチスティックを実現するために、マルチスレッド かつ OpenGL で実装している。
【Qiita記事】 https://qiita.com/PINTO/items/b97b3334ed452cb555e2
【RealSense D435対応版】 https://github.com/PINTO0309/MobileNet-SSD-RealSense.git
MobileNet-SSD + Neural Compute Stick + RaspberryPi3 / MultiStick(3本/Hard)
Youtube: https://youtu.be/sQnFbRSqIA8
・RaspberryPi 3 + Raspbian Stretch
・NCSDK v1.12.00 (NCSDK 2.04 では動作しません)
・Intel Movidius Neural Compute Stick 1本
・OpenCV 3.4.1
・OpenGL
・numpy
・UVC対応のUSB-Webカメラ
- SWAP領域の一時的な拡張
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=2048
$ sudo /etc/init.d/dphys-swapfile restart swapon -s
- パッケージのインストール
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python3-pip python3-numpy git cmake
- NCSDKのインストール
$ cd ~
$ git clone https://github.com/movidius/ncsdk.git
$ cd ncsdk
$ make install
- OpenCVのインストール
$ wget https://github.com/PINTO0309/OpenCVonARMv7/raw/master/libopencv3_3.4.1-20180304.1_armhf.deb
$ sudo apt install -y ./libopencv3_3.4.1-20180304.1_armhf.deb
$ sudo ldconfig
- OpenGLのインストール
$ sudo apt-get install python-opengl
$ sudo -H pip3 install pyopengl
$ sudo -H pip3 install pyopengl_accelerate
$ sudo raspi-config
-
「7.Advanced Options」-「A7 GL Driver」-「G2 GL (Fake KMS)」の順に選択し、Raspberry Pi のOpenGL Driver を有効化
-
再起動
$ sudo reboot
- リソース一式のダウンロード
$ cd ~
$ git clone https://github.com/PINTO0309/MobileNet-SSD.git
-
USB-WEBカメラ(UVC対応) と Neural Compute Stick をRaspberryPiのUSBポートへ接続(Neural Compute Stickをマルチで使用する場合は電圧が不足するためセルフパワーUSB-Hub必須)
-
RaspberryPiとディスプレイをHDMIケーブルで接続
-
MobileNet-SSDの実行
$ cd MobileNet-SSD
$ python3 MultiStickSSD.py
- SWAP領域の縮小
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100
$ sudo /etc/init.d/dphys-swapfile restart swapon -s
https://github.com/movidius/ncappzoo/tree/master/caffe/SSD_MobileNet
https://github.com/FreeApe/VGG-or-MobileNet-SSD
https://github.com/chuanqi305/MobileNet-SSD
Ultra-fast MobileNet-SSD + Neural Compute Stick(NCS) than YoloV2 + Explosion speed by RaspberryPi.
Multiple moving object detection with high accuracy.
Video playback and object detection are executed asynchronously.
In order to realize high speed rendering with multi stick, it is implemented in multithreading/OpenGL.
【Japanese Article】https://qiita.com/PINTO/items/b97b3334ed452cb555e2
【RealSense D435 Version】 https://github.com/PINTO0309/MobileNet-SSD-RealSense.git
MobileNet-SSD + Neural Compute Stick + RaspberryPi3 / MultiStick(3 Stick / Hard Motion)
Youtube: https://youtu.be/sQnFbRSqIA8
・RaspberryPi 3 + Raspbian Stretch
・NCSDK v1.12.00 (It does not work with NCSDK v2.04)
・Intel Movidius Neural Compute Stick 1 piece
・OpenCV 3.4.1
・OpenGL
・numpy
・(UVC)USB-Web Camera
- Temporary extension of SWAP area
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=2048
$ sudo /etc/init.d/dphys-swapfile restart swapon -s
- Installing packages
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python3-pip python3-numpy git cmake
- Installing NCSDK
$ cd ~
$ git clone https://github.com/movidius/ncsdk.git
$ cd ncsdk
$ make install
- Installation of OpenCV
$ wget https://github.com/PINTO0309/OpenCVonARMv7/raw/master/libopencv3_3.4.1-20180304.1_armhf.deb
$ sudo apt install -y ./libopencv3_3.4.1-20180304.1_armhf.deb
$ sudo ldconfig
- Installing OpenGL
$ sudo apt-get install python-opengl
$ sudo -H pip3 install pyopengl
$ sudo -H pip3 install pyopengl_accelerate
$ sudo raspi-config
-
「7.Advanced Options」-「A7 GL Driver」-「G2 GL (Fake KMS)」 and Activate Raspberry Pi's OpenGL Driver
-
Reboot
$ sudo reboot
- Download complete set of resources
$ cd ~
$ git clone https://github.com/PINTO0309/MobileNet-SSD.git
-
Connect USB-WEB camera (UVC compatible) and Neural Compute Stick to RaspberryPi's USB port (self power USB-Hub required due to insufficient voltage when using Neural Compute Stick in multiple)
-
Connect RaspberryPi and display with HDMI cable
-
Running MobileNet-SSD
$ cd MobileNet-SSD
$ python3 MultiStickSSD.py
- Reducing the SWAP area
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100
$ sudo /etc/init.d/dphys-swapfile restart swapon -s
https://github.com/movidius/ncappzoo/tree/master/caffe/SSD_MobileNet
https://github.com/FreeApe/VGG-or-MobileNet-SSD
https://github.com/chuanqi305/MobileNet-SSD