Code Monkey home page Code Monkey logo

mobilenet-ssd's Introduction

[English] MobileNet-SSD

Ultra-fast MobileNet-SSD(MobileNetSSD) + 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.
【Warning】 This repository does not support NCS2.

【Japanese Article】
https://qiita.com/PINTO/items/b97b3334ed452cb555e2


【USB Camera + MultiProcessing High performance version】
Below, when using multiple sticks, it is more than three times the performance of this repository program.
I recommend that you refer to the following repository.
https://github.com/PINTO0309/MobileNet-SSD-RealSense.git

Change history

[July 19, 2018] Corresponds to NCSDK v2.05.00.02 / OpenCV 3.4.2 / FPS View
[July 27, 2018] Add an unnecessary version of OpenGL (USBCamera / MultiStick / MultiProcessing / RealSense)

Image of motion

MobileNet-SSD + Neural Compute Stick + RaspberryPi3 / MultiStick(3 Stick / Hard Motion)

Youtube: https://youtu.be/sQnFbRSqIA8

Riders MultiStick

MobileNet-SSD + Neural Compute Stick(1 Stick) + RaspberryPi3 + USB Camera(640x480)
Youtube: https://youtu.be/_Cbt0gI8niQ
Goku

Environment

・RaspberryPi 3 + Raspbian Stretch

・NCSDK v2.08.01 (It does not work with NCSDK v1 v1 version is here)

・Intel Movidius Neural Compute Stick 1 piece

・OpenCV 3.4.2

・OpenGL

・numpy

・(UVC)USB-Web Camera

Building environment

  1. Temporary extension of SWAP area
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=2048

$ sudo /etc/init.d/dphys-swapfile restart;swapon -s
  1. Installing packages
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python3-pip python3-numpy git cmake libqtgui4 libqt4-test
  1. Installing NCSDK
$ cd ~
$ git clone -b ncsdk2 https://github.com/movidius/ncsdk.git
$ cd ncsdk
$ make install
  1. Installation of OpenCV
$ cd ~
$ wget https://github.com/PINTO0309/OpenCVonARMv7/raw/master/libopencv3_3.4.2-20180709.1_armhf.deb
$ sudo apt install -y ./libopencv3_3.4.2-20180709.1_armhf.deb
$ sudo ldconfig
  1. Installing OpenGL
$ sudo apt-get install python-opengl
$ sudo -H pip3 install pyopengl
$ sudo -H pip3 install pyopengl_accelerate
$ sudo raspi-config
  1. 「7.Advanced Options」-「A7 GL Driver」-「G2 GL (Fake KMS)」 and Activate Raspberry Pi's OpenGL Driver

  2. Reboot

$ sudo reboot
  1. Download complete set of resources
$ cd ~
$ git clone https://github.com/PINTO0309/MobileNet-SSD.git
  1. 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)

  2. Connect RaspberryPi and display with HDMI cable

  3. Running MobileNet-SSD

$ cd MobileNet-SSD
$ python3 MultiStickSSD.py
  1. Reducing the SWAP area
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100

$ sudo /etc/init.d/dphys-swapfile restart;swapon -s

Procedure for generating original learning data

https://github.com/movidius/ncappzoo/tree/master/caffe/SSD_MobileNet
https://github.com/FreeApe/VGG-or-MobileNet-SSD
https://github.com/chuanqi305/MobileNet-SSD
https://github.com/avBuffer/MobilenetSSD_caffe
   

[Japanese] MobileNet-SSD

YoloV2 より超速 MobileNetSSD(MobileNetSSD)+Neural Compute Stick(NCS)+Raspberry Piによる爆速・高精度の複数動体検知
映像再生と物体検出は非同期実行。
マルチスティックを実現するために、マルチスレッド かつ OpenGL で実装している。
【Qiita記事】 https://qiita.com/PINTO/items/b97b3334ed452cb555e2
【RealSense D435 + MultiProcessing対応版】 https://github.com/PINTO0309/MobileNet-SSD-RealSense.git

変更履歴

[2018/07/19] NCSDK v2.05.00.02対応 / OpenCV 3.4.2対応 / FPS View対応

動作イメージ

MobileNet-SSD + Neural Compute Stick + RaspberryPi3 / MultiStick(3本/Hard)

Youtube: https://youtu.be/sQnFbRSqIA8

Riders MultiStick

MobileNet-SSD + Neural Compute Stick(1 Stick) + RaspberryPi3 + USB Camera(640x480)
Youtube: https://youtu.be/_Cbt0gI8niQ
Goku

環境

・RaspberryPi 3 + Raspbian Stretch

・NCSDK v2.08.01 (NCSDK v1では動作しません v1バージョンはこちら)

・Intel Movidius Neural Compute Stick 1本

・OpenCV 3.4.2

・OpenGL

・numpy

・UVC対応のUSB-Webカメラ

環境構築

  1. SWAP領域の一時的な拡張
$ sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=2048

$ sudo /etc/init.d/dphys-swapfile restart;swapon -s
  1. パッケージのインストール
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python3-pip python3-numpy git cmake libqtgui4 libqt4-test
  1. NCSDKのインストール
$ cd ~
$ git clone https://github.com/movidius/ncsdk.git
$ cd ncsdk
$ make install
  1. OpenCVのインストール
$ wget https://github.com/PINTO0309/OpenCVonARMv7/raw/master/libopencv3_3.4.2-20180709.1_armhf.deb
$ sudo apt install -y ./libopencv3_3.4.2-20180709.1_armhf.deb
$ sudo ldconfig
  1. OpenGLのインストール
$ sudo apt-get install python-opengl
$ sudo -H pip3 install pyopengl
$ sudo -H pip3 install pyopengl_accelerate
$ sudo raspi-config
  1. 「7.Advanced Options」-「A7 GL Driver」-「G2 GL (Fake KMS)」の順に選択し、Raspberry Pi のOpenGL Driver を有効化

  2. 再起動

$ sudo reboot
  1. リソース一式のダウンロード
$ cd ~
$ git clone https://github.com/PINTO0309/MobileNet-SSD.git
  1. USB-WEBカメラ(UVC対応) と Neural Compute Stick をRaspberryPiのUSBポートへ接続(Neural Compute Stickをマルチで使用する場合は電圧が不足するためセルフパワーUSB-Hub必須)

  2. RaspberryPiとディスプレイをHDMIケーブルで接続

  3. MobileNet-SSDの実行

$ cd MobileNet-SSD
$ python3 MultiStickSSD.py
  1. 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
https://github.com/avBuffer/MobilenetSSD_caffe
 

mobilenet-ssd's People

Contributors

pinto0309 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobilenet-ssd's Issues

ncsdk2.5 install error

when i run make install i meet the error of Installation failed: Command 'sudo -H -E pip3 install --trusted-host files.pythonhosted.org Cython graphviz scikit-image' return code=2. Error on line 308 in ./install-utilities.sh. Will exit
i want to know how to solve it

OpenCV installation error

Traceback (most recent call last):
File "MultiStickSSD.py", line 12, in
import cv2
File "/home/pi/.local/lib/python3.5/site-packages/cv2/init.py", line 3, in
from .cv2 import *
ImportError: libQtGui.so.4: cannot open shared object file: No such file or directory

import cv2 works with python 2 but it doesn't work with python 3.

help with SSD mobilenet on raspberry pi

I think you will be my helper ... please share it to me.....
I transferred a file ( SSD mobilenet model for classification) from my computer to raspberry pi (connected via VNC viewer) and try to execute the model on the RPi python 3 IDE ... but it give nothing like the image below... please let me understand your steps ....
capture

Movidius

I get my movidius ncs from amazon right now and i need to use it for fast computing ability.
model : ssd mobilenet
framework: caffe

please show me how to get the ncs work with my pi...
I have installed the NCS SDK on my raspberry pi before I received my movidius from amazon carrier using the below link:
dependencies like opencv and tensorflow are also installed by default based on the link:
https://github.com/movidius/ncsdk

Latest SDK (2.08) support

Hi Pinto,

Great work!
Looks like Movidius has released a latest NVSDK v2.08.01. I found this version of SDK does not support the graph file included in your repo,
Error messages:

W: [         0] checkGraphMonitorResponse:931	Graph monitor request returned error
W: [         0] ncGraphAllocate:1125	The device didn't accept the graph

W: [         0] ncGraphAllocate:1128	graph file version is incompatible

Traceback (most recent call last):
  File "MultiStickSSD.py", line 44, in <module>
    graphHandle.append(graph[devnum].allocate_with_fifos(devHandle[devnum], graph_buffer))
  File "/home/pi/.local/lib/python3.5/site-packages/mvnc/mvncapi.py", line 613, in allocate_with_fifos
    raise Exception(Status(status))
Exception: Status.UNSUPPORTED_GRAPH_FILE

I tried using the graph file compiled localy from /home/pi/Desktop/ncappzoo/caffe/SSD_MobileNet, however, the detection result is always 1 result with class name tvmonitor and a bounding box of whole frame size.

As you have successfully run the SSD model before, would you please try the latest NVSDK and update this repo if possible?

Thanks!

training a model

Hi my friend
I used to tested a model using somebody's trained prototxt and caffemodel caffe model files.. but it skip the detection of the object and even sometimes it does not detect at all. but it worked for the person who provide it with the same video file....
do you think i should have trained (fine tune it)..
so could you show me how should I train the caffe model for a my dataset.
i need to detect a person.....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.