Qengineering / Face-Recognition-with-Mask-Jetson-Nano

Recognize 2000+ faces on your Jetson Nano with additional mask detection, auto-fill and anti-spoofing
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
35 stars 6 forks source link

Sometimes it doesnt recognize a person at all. #10

Closed rsingh2083 closed 3 years ago

rsingh2083 commented 3 years ago

Keeps throwing "Fake"/"Stranger" even for a person with 3 photographs. While sometimes it works. This happened when we took the photo in the same room, we tested this application for. I cant understand why this erratic behavior, is it due to lightening of room or anything else

Qengineering commented 3 years ago

This behavior is hard to overcome. Please use the command line input when adding a face to the collection $ ./main -MyNewFace.jpg The picture is going to be processed as being taken 'live' with the camera. Manually putting pictures in the database is not advised. The needed warp projection isn't applied in this case.

Second possible reason can be the moment the picture is taken. Using auto fill will place a picture in the database at the moment it's considered to be correct. Not too much blur, and facing the camera more or less. Please take a look in the database to see if all the faces are sharp and facing the camera in front.

rsingh2083 commented 3 years ago

I didnt put images manually. I took snapshot of three images of a person and renamed them as p1.jpg, p1#1.jpg, p2#2.jpg and then ran ./Facerecognition -p1.jpg (...etc) The problem with autofill is that its populating some blurry and choppy images also

Qengineering commented 3 years ago

As far as I can see, you did the correct thing. Running ./Facerecognition p1.jpg will load only p1 in the database. You can check if the warp projection is performed on the face by comparing the original and the one in the database. Most times the face in the database will be 'wider'.

rsingh2083 commented 3 years ago

Your readme mentions that RetinaFace is more accurate and input is 324x240. But when I add image to database using Retina enabled FaceRecognition, then also the size of images in database are 112x112 pixels only.

Qengineering commented 3 years ago

There are a few deep learning models working here.

RetinaFace to recognize a face in a scene, or MtCNN to recognize a face in a scene. Live is trying to determine if a person is live or some photo of a face. Mask, to see if a person is wearing a mask. MobileFaceNet to do the actual recognition of a person from the database.

Each model has it's unique input size. In this case uses RetinaFace 324x240, whilst MobileFaceNet works with cropped faces of 112x112.