YoloV2+Neural Compute Stick(NCS)+Raspberry Piの限界性能に挑戦 Challenge the marginal performance of YoloV2 + Neural Compute Stick + Raspberry Pi
https://qiita.com/PINTO/items/db3ab44a3e2bcd87f2d8
TinyYolo + Neural Compute Stick + RaspberryPi3
Youtube: https://youtu.be/L4RvVLyo8Rc
・RaspberryPi 3 + Raspbian Stretch
・NCSDK v1.12.00
・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/blob/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/TinyYolo.git
-
USB-WEBカメラ(UVC対応) と Neural Compute Stick をRaspberryPiのUSBポートへ接続(Neural Compute Stickをマルチで使用する場合は電圧が不足するためセルフパワーUSB-Hub必須)
-
RaspberryPiとディスプレイをHDMIケーブルで接続
-
MultiStick.pyの実行
$ cd TinyYolo
$ python3 ./detectionExample/MultiStick.py
- SWAP領域の縮小
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100
$ sudo /etc/init.d/dphys-swapfile restart swapon -s
Challenge the marginal performance of YoloV2 + Neural Compute Stick + Raspberry Pi
https://qiita.com/PINTO/items/db3ab44a3e2bcd87f2d8
TinyYolo + Neural Compute Stick + RaspberryPi3
Youtube: https://youtu.be/L4RvVLyo8Rc
・RaspberryPi 3 + Raspbian Stretch
・NCSDK v1.12.00
・Intel Movidius Neural Compute Stick 1本
・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/blob/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/TinyYolo.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 MultiStick.py
$ cd TinyYolo
$ python3 ./detectionExample/MultiStick.py
- Reducing the SWAP area
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100
$ sudo /etc/init.d/dphys-swapfile restart swapon -s