Path: blob/master/Face-Recognition-with-ArcFace/README.md
3118 views
Face recognition with ArcFace
Code for https://www.learnopencv.com/face-recognition-with-arcface/ blog post which illustrates concepts from face recognition.
Original source code
Some parts of the code and trained face identification model are from face.evoLVe repository which is released under the MIT License. Huge thanks to them!
Installation
Use your Python virtual environment such as virtualenv to isolate project.
Then install all dependencies.
Note: GPU is not required to run this code, but model inference will be faster if you have one.
Model
Download checkpoint for a model from GoogleDrive/Baidu and move it to checkpoint/backbone_ir50_ms1m_epoch120.pth
Data
All datasets with faces must support ImageFolder format. Look at the prepared examples in data
directory.
For all subsequent commands use tags
argument to select specific datasets in data
directory.
Data preprocessing
To prepare data with cropped and aligned faces from your original images, run:
Note: crop_size argument must be either 112 or 224.
Similarity visualization
To visualize similarity between faces in table format, run:
The result for each dataset will be saved in images
directory.
t-SNE visualization
To use t-SNE for dimensionality reduction and 2D visualization of face embeddings, run:
Results will be plotted in a separate window. You can enlarge the image to look at details.
AI Courses by OpenCV
Want to become an expert in AI? AI Courses by OpenCV is a great place to start.