There are different ways to enable access control and personalize common objects (physical key, pin code, fingerprint or face authentication). Face recognition is the most convenient way to authenticate users because it is immediate, touchless, and secure (biometric data).
Approach
Frames are grabbed from a camera input (/dev/videox) and processed by two neural network models (face detection and face recognition) interpreted by the TensorFlow™ Lite runtime framework.
A GStreamer pipeline is used to stream camera frames (using v4l2src), to display a preview (using waylandsink), and to execute neural network inference (using appsink).
The result of the inference is displayed using overlay generated by GtkWidgets with Cairo.

Sensor
USB webCam or built-in camera.
Data
Data format: RGB888 color input image with resolution of 96×96
Results
Model: Custom CNN for face detection and for face recognition
Results on STM32MP157F (High-perf)
The average execution frame rate to execute both face detection and face recognition on 1 face is around 5 fps:
– Face detection execution time ~ 70 ms
– Face recognition execution time ~ 55 ms