While working on Camera Live Stream Service, I decided to add machine learning to this project. That means our camera can learn who the family members are, and during the video stream, send warning to the owner if someone on camera is not a family member. That is just one idea; you may have more ideas about how to use this with other devices - maybe even a door opener.
IDE for Python Development PycharmDownload Pycharm development tool: https://www.jetbrains.com/pycharm/download/
Python Virtual environment Installationsudo pip install virtualenv
Create new python projectmkdir project
cd project
virtualenv venv
Setup Boost PythonWe need boost python when compile Dlib c++ for Python module.
To compile Boost.Python yourself download boost from http://boost.org and then go into the boost root folder.
./bootstrap.sh --with-libraries=python
./b2
sudo ./b2 install
Setup dlib C++ libraryDlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems. https://github.com/davisking/dlib
brew install cmake
git clone https://github.com/davisking/dlib.git
cd dlib
mkdir build; cd build; cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1; cmake --build .
Activate Python Virtual Environment in our Python project
cd /PATH-OUR-PROJECT
cd venv
source bin/activate
python setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA
FlaskUse flask as Python framework to build API service. API: http://flask.pocoo.org/docs/0.12/api
from flask import Flask,Response,json
app = Flask(__name__)
@app route('/', methods=['GET'])
def home():
return Response(json.dumps({"api": "1.0"}), status=200, mimetype='application/json')
if __name__ == "__main__":
app.run()
DatabaseWe can use any database to store users info. In this project I just use sqlite3 default support by Python. Tool for design slqlite: http://sqlitebrowser.org/
Part 1: Setup and begin with Flask
Part 2: Face Recognition
- Please subscribe to my YouTube channel for the next part.






Comments