Using python
Write By ITJoker Time:2018.10.08
Update Time:2019.01.01
Program Version:beta-1.0
- Through the
imwrite()
function in opencv, take pictures of the driveless USB camera and store them inimage.jpg
format. - Then submit to baidu's face search API to realize face recognition through the post method in HTTP protocol.
- Then through the python
rpi.gpio
library to control the raspberry pie GPIO, to achieve the relay on and off state.
-
Python Version
2.7.13
or higher(Does not supportPython3
) -
You should execute commands below:
sudo apt-get install fswebcam libv41-dev git
pip install requests
pip install commands
- Then clone this repositories
git clone https://github.com/ITJoker233/FaceRecognitionAccessControlRaspberry-Python
-
Configuration of the main.py and fill in the baidu API*(public key and secret key)*.
Also you can choose training set (
lbpcascade_frontalface.xml
orhaarcascade_frontalface_default.xml
) -
Execute the
main.py
using root access
This Program is a example,You can use this program to achieve the functions you want!!
- Currently unable to solve the problem of camera display screen is small
If you like the project, give it to a star, or donate to the author.https://blog.itjoker.cn/donate :)