Face recognition and live estimation on Raspberry Pi 4B with average FPS around 20 and 2800+ faces loaded.
2021-07-22
: reworked cmakefiles and livefacereco code, added ParallelVideoCapture module and DatasetHandler module. y9luiz
2020-09-05
: with the help of konglingzheng, add ncnn lib of nano, please simply change the path in the cmakelist when other platform is used.
2020-08-26
: add ncnn libs (ubunutu, arm64-v8a, armeabi-v7a, and RaspberryPi4B ) to include folder
The project implements Face Recognition and Face Anti Spoofing on Raspberry pi with the models transformed to ncnn. Besides, the whole project is designed as an entrance guard system by reading face images in the img folder and determining whether the input face is in the dataset by Arcface. The most interesting function is that it is capable to estimate whether the face getting from the camera is real just relaying on the input image instead of with the help of human body sensors or temperature sensors. As a result, it can avoid the situation of deceived by false faces, including printed paper photos, the display screen of electronic products, silicone masks, 3D human images, etc.
Neural Network Inference
Detection:
Recognition:
Anti-Spoofing:
The program was run with 2859 faces in img folder, which is enough for a moderate entrance guard system.
There is only one image of me(not wearing a mask) in the database, and it is capable to recognize me when wearing a mask(not robust enough). The performance can be improved when retinaface is used as the Detector(TODO).
The average FPS is around 20, and it successfully recognized me from the database.
The number in cyan indicates the score for face recognition, and the number in yellow shows the confidence of live estimation.
OpenCV
Building OpenCV on Raspberry Pi might be slightly different from that in other linux systems. If you met some problem, you may find this website helpful.
project_path:
set project_path
in livefacereco.hpp into your own
face database:
set record_face=true
in livefacereco.hpp to add your face to database, you can rename it in img folder.
make sure you have changed project_path
to your own
mkdir build
cd build
cmake ..
make -j4
./LiveFaceReco
@inproceedings{deng2018arcface, title={ArcFace: Additive Angular Margin Loss for Deep Face Recognition}, author={Deng, Jiankang and Guo, Jia and Niannan, Xue and Zafeiriou, Stefanos}, booktitle={CVPR}, year={2019} } @inproceedings{deng2019retinaface, title={RetinaFace: Single-stage Dense Face Localisation in the Wild}, author={Deng, Jiankang and Guo, Jia and Yuxiang, Zhou and Jinke Yu and Irene Kotsia and Zafeiriou, Stefanos}, booktitle={arxiv}, year={2019} } @inproceedings{ncnn, title={ncnn https://github.com/ElegantGod/ncnn}, author={ElegantGod}, } @inproceedings{Face-Recognition-Cpp, title={Face-Recognition-Cpp https://github.com/markson14/Face-Recognition-Cpp}, author={markson14}, } @inproceedings{insightface_ncnn, title={insightface_ncnn https://github.com/KangKangLoveCat/insightface_ncnn}, author={KangKangLoveCat}, } @inproceedings{Silent-Face-Anti-Spoofing, title={Silent-Face-Anti-Spoofing https://github.com/minivision-ai/Silent-Face-Anti-Spoofing}, author={minivision-ai}, }
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。