This is the source code of the article: Importance of Accurate Facial Landmarks
On a Raspberry Pi 4B or a PC with Ubuntu/Debian, run in terminal:
git clone https://github.com/cortictechnology/spatial_face_recognition.git
cd spatial_face_recognition
bash install_dependencies.sh
- Make sure the OAK-D device is plug into the Pi or PC.
- In the terminal, run
python3 main.py
You can enable the drawing of face landmarks by adding in the --show_lm flag:
python3 main.py --show_lm
We have included some sample celebrities in the database, you can follow the next section to add your own face into the database.
- When the program is running, look into the camera with your front face.
- Press the "a" key on the keyboard.
- In the terminal, enter your name and press Enter.
- Now move your head around to capture different angles of your face.
- You should see yourself being recognized.
In the models folder, 4 models are provided:
- face-detection-0200.blob: Face detection nework from OpenVino's website
- landmarks-regression-retail-0009_openvino_2021.2_6shave.blob: Face landmark detction model from depthAI's sample project
- age-gender-recognition-retail-0013_openvino_2021.2_6shave.blob: Age and Gender estimation model from depthAI's sample project
- mobilefacenet.blob: Face recognition model converted from insightface's mxnet model