This example demonstrates the Gen2 Pipeline Builder running face detection network, head posture estimation network and face recognition network
usage: main.py [-name NAME]
optional arguments:
-name, --name Name of the person for database saving [Optional]
Before this example works, you have to "teach" it what face to associate with which name:
- Run
python3 main.py --name JohnDoe
. Then you should face the camera to JohnDoe from different angles, so he will later be recognized from different angles as well. This will just save (his) face vectors to the person's databse (in this caseJohnDoe.npz
). - Repeat step 1 for other people you would like to recognize
- Run
python3 main.py
for face recognition demo. Whenever the device sees a new face, it will calculate the face vector (arcface NN model) and it will get compared with other vectors from the databases (.npz
) using cosine distance.
Run the face-detection-retail-0004 model to detect the face in the image and intercept the facial image.
Run the head-pose-estimation-adas-0001 model to Detect head tilt angle and adjust head posture.
Run the face-recognition-mobilefacenet-arcface.blob model to Recognize the face.
Install requirements
python3 -m pip install -r requirements.txt