My personal dive into using deep-learning for face recognition/verification
This is something I’m building to get a better understanding of what it is like to create a facial recognition system that is can work in the wild (and not just a fun tutorial). The goal is to build a facial recoginition system that is
- fast AF
This is build on top of timesler’s facenet-pytorch and some opencv to wrap it all up into a nice useable form (later we might try to get this working in the browser).
OpenCV to use the repo.
There is a hacky database that we are using to store the images for the people in the system. We load them from the
folder and cache the results for the models to make things efficient. You can add a person by creating a new folder
db/ folder and adding images of the person. Make sure the images you add only contain the person in question.
python recorder.py to record an video with the person you want to verify. Right now it doesn’t support real-time
but will add soon.
recorder.py python recorder.py --output <output_file> output: (default - output.avi) the name of the file saved after recording
Now you can run
python face_verifier.py <name> to run the verifier which will now track and verify the person
with the name given. The name should already be in the db.
face_verifier.py python face_verifier <name> --input <input_video_file> --output <output_video_file> --recache name: the name of the person that we need to verifiy with. This person has to be in the db. input: (default - output.avi) the input video file (recorded with the recoder) with person who we want to verify. output: (default - processed.avi) this script will save the processed video showing the tracking and verification information. --recache - a flag to run the recaching process. The db is cached for performance so if you add new images do a recache before runing verifier
- try retraining the models for verification
- using ONNX.js, try to run this in the browser
- try newer arch as base arch for the verification network (efficient net)
- maybe try yolo v5 for face detection.