All Projects → Qengineering → Face-Recognition-Jetson-Nano

Qengineering / Face-Recognition-Jetson-Nano

Licence: BSD-3-Clause license
Recognize 2000+ faces on your Jetson Nano with database auto-fill and anti-spoofing

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to Face-Recognition-Jetson-Nano

Face-Recognition-Raspberry-Pi-64-bits
Recognize 2000+ faces on your Raspberry Pi 4 with database auto-fill and anti-spoofing
Stars: ✭ 48 (-23.81%)
Mutual labels:  face-recognition, face-detection, ncnn, mtcnn-face-detection, arcface, blur-filter, anti-spoofing, retinaface
FaceRecognitionCpp
Large input size REAL-TIME Face Detector on Cpp. It can also support face verification using MobileFaceNet+Arcface with real-time inference. 480P Over 30FPS on CPU
Stars: ✭ 40 (-36.51%)
Mutual labels:  face-recognition, face-detection, mtcnn, arcface, retinaface
lite.ai.toolkit
🛠 A lite C++ toolkit of awesome AI models with ONNXRuntime, NCNN, MNN and TNN. YOLOX, YOLOP, MODNet, YOLOR, NanoDet, YOLOX, SCRFD, YOLOX . MNN, NCNN, TNN, ONNXRuntime, CPU/GPU.
Stars: ✭ 1,354 (+2049.21%)
Mutual labels:  face-recognition, face-detection, ncnn, retinaface
InsightFace-REST
InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Stars: ✭ 308 (+388.89%)
Mutual labels:  face-recognition, face-detection, arcface, retinaface
Insightface
State-of-the-art 2D and 3D Face Analysis Project
Stars: ✭ 10,886 (+17179.37%)
Mutual labels:  face-recognition, face-detection, arcface, retinaface
Face Recognition Cpp
Real Time Face Recognition Detector. Over 30FPS on CPU!
Stars: ✭ 68 (+7.94%)
Mutual labels:  face-recognition, face-detection, mtcnn
Facenet
Face recognition using Tensorflow
Stars: ✭ 12,189 (+19247.62%)
Mutual labels:  face-recognition, face-detection, mtcnn
retinaface
RetinaFace: Deep Face Detection Library for Python
Stars: ✭ 242 (+284.13%)
Mutual labels:  face-recognition, face-detection, retinaface
FaceIDLight
A lightweight face-recognition toolbox and pipeline based on tensorflow-lite
Stars: ✭ 17 (-73.02%)
Mutual labels:  face-recognition, face-detection, mtcnn
Awesome Face Detection
Compare with various detectors - s3fd, dlib, ocv, ocv-dnn, mtcnn-pytorch, face_recognition
Stars: ✭ 106 (+68.25%)
Mutual labels:  face-recognition, face-detection, mtcnn
Facerecognition
This is an implematation project of face detection and recognition. The face detection using MTCNN algorithm, and recognition using LightenenCNN algorithm.
Stars: ✭ 137 (+117.46%)
Mutual labels:  face-recognition, face-detection, mtcnn
Facenet Pytorch
Pretrained Pytorch face detection (MTCNN) and facial recognition (InceptionResnet) models
Stars: ✭ 2,564 (+3969.84%)
Mutual labels:  face-recognition, face-detection, mtcnn
Awesome Face recognition
papers about Face Detection; Face Alignment; Face Recognition && Face Identification && Face Verification && Face Representation; Face Reconstruction; Face Tracking; Face Super-Resolution && Face Deblurring; Face Generation && Face Synthesis; Face Transfer; Face Anti-Spoofing; Face Retrieval;
Stars: ✭ 3,220 (+5011.11%)
Mutual labels:  face-recognition, face-detection
Deepstream Project
This is a highly separated deployment project based on Deepstream , including the full range of Yolo and continuously expanding deployment projects such as Ocr.
Stars: ✭ 120 (+90.48%)
Mutual labels:  face-recognition, arcface
DeepFaceRecognition
Face Recognition with Transfer Learning
Stars: ✭ 16 (-74.6%)
Mutual labels:  face-recognition, face-detection
Facepapercollection
A collection of face related papers
Stars: ✭ 241 (+282.54%)
Mutual labels:  face-recognition, face-detection
Face-Recognition
A Java application for Face Recognition under expressions, occlusions and pose variations.
Stars: ✭ 55 (-12.7%)
Mutual labels:  face-recognition, face-detection
FaceRecog
Realtime Facial recognition system using Siamese neural network
Stars: ✭ 47 (-25.4%)
Mutual labels:  face-recognition, face-detection
Facerecognition
Nextcloud app that implement a basic facial recognition system.
Stars: ✭ 226 (+258.73%)
Mutual labels:  face-recognition, face-detection
Detect-Facial-Features
Code example demonstrating how to detect eyes, nose, lips, and jaw with dlib, OpenCV, and Python
Stars: ✭ 42 (-33.33%)
Mutual labels:  face-recognition, face-detection

Recognize 2000+ faces with your Jetson Nano.

output image

A fast face recognition and face recording running on a Jetson Nano.

License

This C++ application recognizes a person from a database of more than 2000 faces. It is built for a Jetson Nano, but can easily be ported to other platforms.

First, the faces and their landmarks are detected by RetinaFace or MTCNN. Next, the database is scanned with Arcface for the matching face. In the end, Face Anti Spoofing tests whether the person in front of the camera is real and not a mask or a cardboard photo.

If the face is not found in the database, it will be added automatically. A blur filter ensures only sharp faces in the database. One photo per person is sufficient, although more does not hurt.

Special made for a Jetson Nano see Q-engineering deep learning examples


Benchmark.

Model Jetson Nano 2015 MHz Jetson Nano 1479 MHz RPi 4 64-OS 1950 MHz RPi 4 64-OS 1500 MHz
MTCNN 11 mS 14 mS 22 mS 25 mS
RetinaFace 15 mS 19 mS 35 mS 37 mS
ArcFace +17 mS +21 mS +36 mS +40 mS
Spoofing +25 mS +37 mS +37 mS +45 mS

Dependencies.

April 4 2021: Adapted for ncnn version 20210322 or later

To run the application, you have to:

  • The Tencent ncnn framework installed. Install ncnn
  • Code::Blocks installed. ($ sudo apt-get install codeblocks)

Installing the app.

To extract and run the application in Code::Blocks
$ mkdir MyDir
$ cd MyDir
$ wget https://github.com/Qengineering/Face-Recognition-Jetson-Nano/archive/refs/heads/main.zip
$ unzip -j main.zip
Remove main.zip and README.md as they are no longer needed.
$ rm main.zip
$ rm README.md

Your MyDir folder must now look like this:
Graham Norton.jpg (example image)
FaceRecognition.cbp (code::blocks project file)
Norton_A.mp4 (movie with faces to load)
Norton_2.mp4 (movie to check)
img (database folder)
models (folder with used ncnn deep learning models)
src (C++ source files)
include (the C++ headers)


Running the app.

To run the application load the project file FaceRecognition.cbp in Code::Blocks.
First, we are going to fill the database with new faces. The database img initial holds one face, Graham.jpg.

output image

Check in main.cpp line 253. It must be cv::VideoCapture cap("Norton_A.mp4");

Compile and run the app. Movie Norton_A.mp4 will be played and new faces are stored in the database. In the end, you have the database filled as below.

output image

Next, alter the name of the movie in line 253 of main.cpp to Norton_2.mpg. Compile and run the application again. You will see that all the faces are correctly recognized. It can still happen that faces are added to the database due to strange angles or grimaces.


Database.

The application can easily contain more than 2000 faces. There are reports that ArcFace works flawlessly with over 5000 faces. With large databases, it is important to keep your face "natural". It means a front view photo with eyes open and mouth closed without a smile or other funny faces.
The database is filled "on the fly", as you have seen above. It is also possible to manually add a face to the databases. To do this, run the application from the command-line and enter the name of the image as an argument. For example ./FaceRecognition "Graham Norton.jpg" Note the quotation marks around the name if it has a space.

You can give the faces a corresponding name. By using a hash, you can associate multiple pictures with the same name.

output image

By the way, note the warp perspective of Graham Norton's face that we added via a command-line argument and the crop of the same photo already saved in the database. This is done by the ArcFace algorithms.

The blur filter prevents vague or imprecise faces from being added to the database. Below you see a few examples of faces we encounter in the database when de blur filter was switched off.

output image

Another safety measure is the orientation of the face. Only faces in front of the camera are added to the database. Faces "in profile" are often inaccurate in large databases.


Code.

The application is written in C ++. The setup is flexible and easy to adapt to your own needs. See it as a skeleton which you can expand yourself. Some hints. In main .cpp at line 21 you see a few defines.

#define RETINA                  //comment if you want to use MtCNN landmark detection instead
#define RECOGNIZE_FACE
#define TEST_LIVING
#define AUTO_FILL_DATABASE
#define BLUR_FILTER_STRANGER
// some diagnostics
#define SHOW_LEGEND
#define SHOW_LANDMARKS

By commenting the line the define is switched off. For instance, if you do not want to incorporate the anti-spoofing test (saves you 37 mS), comment this line. The MtCNN face detection is switched on by turning RETINA off.
Another important point is that only one face is labelled. It is no problem to loop through all faces. However, they are usually too small to be recognized with great accuracy. Besides, your FPS will drop also. Note, the input image for the RetinaFace is 324 x 240 pixels. Larger pictures are resized to that format. ArcFace works with an input of 112 x 112 pixels. If you have a large input format, you could extract the faces at a larger scale from this image, once you have the coordinates from the RetinaFace network. Now, faces are to be recognized with much greater accuracy. Of course, there will be not much of an FPS left.


WebCam.

If you want to use a camera please alter line 253 in main.cpp to
cv::VideoCapture cap(0); //WebCam
If you want to run a movie please alter line 253 in main.cpp to
cv::VideoCapture cap("Norton_2.mp4"); //Movie


Papers.

MTCNN
RetinaFace
ArcFace
Anti spoofing


Thanks.

https://github.com/Tencent/ncnn
https://github.com/nihui
https://github.com/LicheeX/MTCNN-NCNN
https://github.com/XinghaoChen9/LiveFaceReco_RaspberryPi
https://github.com/deepinsight/insightface
https://github.com/minivision-ai/Silent-Face-Anti-Spoofing
https://github.com/Qengineering/Blur-detection-with-FFT-in-C

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].