Face Recoginition is my project of the deep learning class, which is organized by AI For Everyone (AI4E).
In this project, I have referred many face detect, face recognition model as David Sandberg's facenet, InsightFace and many other repos on github. Lastly, I end up with Ultra-lightweight face detection model (ULFD) face detector and face.evoLVe face recognizer.
Project has not 100% done yet. TODO:
- Torch model serving
- Complete pipeline for production
Use the package manager pip to install package.
pip install -r requirement.txt
NOTE: You need GPU with cuda to run model in realtime
Performance was evaluated on my laptop with AMD Ryzen 7 4800HS and NVIDIA GTX 1660TI Max-Q.
Model | FPS |
---|---|
MTCNN + FaceNet + SVM | 8 |
ULFD + face.evoLVe + SVM | 45 |
Pre-trained model can be found here.
To train a new SVM classifier: Use train_classifier.py. Your dataset should be like:
Dataset
-> id1
-> id1_1.jpg
-> id1_2.jpg
...
-> id2
-> id1_1.jpg
-> id1_2.jpg
...
...
To recognize:
python quickstart.py --path test.mp4
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.