This is a project of the facial recognition with Movidius on RaspberryPi 3B+ platform. It also uses Django and Django REST framework which providing the web platform. The project would like to build a safety and intelligent face recognition system in AI era.
If you appreciate the content 📖, support projects visibility, give 👍| ⭐| 👏
The code is tested using Tensorflow r1.7 and Movidius NCSDK2 under Debin 2018-06-27(Kernel version:4.14) with django 2.1.5 and Python 3.5 & 3.6.
django_venv/ # django virtual env for RPI
face_recognition_model/ # Movidius NCS code
iot_control/ # iot control code
ran-django-template/ # django platform using my own model
requirements.txt # requirements for run the code
- Install requirements
pip install -r requirements.txt
-
Install Neural Compute Application Zoo
Method attached below.
-
Install rpi-mjpg-streamer
Method attached below.
-
Run ran-django-template
cd ran-django-template
python manage.py runserver 0.0.0.0:8000
- Run face_recognition_model
cd face_recognition_model
make run
- Run iot_control
cd iot_control
python iot_controller.py
Admin Account
python manage.py createsuperuser
username: ranxiaolang
email: YOUR EMAIL
password: ranxiaolang
Access the web page though this link: http://127.0.0.1:8000/admin .
- Logitech HD Webcam C270
- Micro SD Card 32G
- Raspberry Pi 3 B+
- Intel Movidius Neural Compute Stick
The code requires Python 3.5 or Python 3.6, Tensorflow 1.7 or later, as well as the following python libraries:
- Pillow
- django
- django-allauth 0.37.1
- django-widget-tweaks 1.4.3
- pip 18.0
- qrcode 6.0
- setuptools 40.4.3
- djangorestframework
- markdown
- django-filter
Those modules can be installed using: pip3 install xxx
or pip install xxx
.
Follow How to run it
This repository is a place for any interested developers to share their projects (code and Neural Network content) that make use of the Intel® Movidius™ Neural Compute Stick (Intel® Movidius™ NCS) and associated Intel® Movidius™ Neural Compute Software Development Kit.
You can use the following url(NC App Zoo) or git command to use the ncsdk2 branch of the NC App Zoo repo:
git clone -b ncsdk2 https://github.com/movidius/ncappzoo.git
pip3 -V
sudo pip3 install -U setuptools
sudo pip3 install -U django
sudo pip3 install -U djangorestframework
sudo pip3 install -U django-filter
sudo pip3 install -U markdown
sudo pip3 install -U requests
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
sudo python3 setup.py install
cd
git clone https://github.com/adafruit/Adafruit_Python_BMP.git
cd Adafruit_Python_BMP
sudo python3 setup.py install
cd
sudo pip3 install psutil
Instructions and helper scripts for running mjpg-streamer on Raspberry Pi.
$ sudo raspi-config
$ sudo apt-get update
$ sudo apt-get install build-essential libjpeg8-dev imagemagick libv4l-dev git cmake uvcdynctrl
$ sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h
$ git clone https://github.com/jacksonliam/mjpg-streamer
$ cd mjpg-streamer/mjpg-streamer-experimental
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=.. .
$ make install
$ git clone https://github.com/meinside/rpi-mjpg-streamer.git
# copy & edit run-mjpg-streamer.sh to your environment or needs
$ cp rpi-mjpg-streamer/run-mjpg-streamer.sh.sample somewhere/run-mjpg-streamer.sh
$ vi somewhere/run-mjpg-streamer.sh
# then run
$ somewhere/run-mjpg-streamer.sh
# copy & edit systemd/mjpg-streamer.service file,
$ sudo cp rpi-mjpg-streamer/systemd/mjpg-streamer.service.sample /lib/systemd/system/mjpg-streamer.service
$ sudo vi /lib/systemd/system/mjpg-streamer.service
# then register as a service
$ sudo systemctl enable mjpg-streamer.service
# or remove it
$ sudo systemctl disable mjpg-streamer.service
# and start/stop it
$ sudo systemctl start mjpg-streamer.service
$ sudo systemctl stop mjpg-streamer.service
Connect through the web browser:
Most modern browsers(including mobile browsers like Safari and Chrome) will show the live stream immediately.
Method 1
pip3 install virtualenv
Copy django_venv and activate
source venv/bin/activate
Method 2
pip install -r requirements.txt
chmod 666 db.sqlite3
chmod 777 xxx
Just can be used for non-business projects. If you use ran-django-template, please give me a star. Thanks!