Taken from InsightFace_PyTorch. More explanation and references can be referred to the original repo.
The purpose of this repo is to fix and modify the inferencing section of the original repo.
Tested on Ubuntu 18.04
- Clone the repo
- Download pretrained_model from original repo. Tested with IR-SE50 model
- Place downloaded model in the
work_space/save/
directory and rename tomodel_cpu_final.pth
for cpu machine. - Install all dependencies from requirements.txt
- Setup virtual environment
virtualenv env -p python3
pip install -r requirements.txt
All face data (images, embeddings, etc) are stored in the facebank/
directory. You will need to make the directory in data/
Then, prepare the face you want to detect. There are 2 preparation methods.
- Use pre-existing face images by placing them into the directory
data/facebank/
name1/
photo1.jpg
photo2.jpg
...
name2/
photo1.jpg
photo2.jpg
- Use webcam to capture new images
python take_pic.py -n name
press 't' to capture and 'q' to exit
This will create a directory called name
in data/facebank
. All captured faces are stored inside it.
python face_verify.py
To update facebank, use -u
flag
python face_verify.py -u
Press 'q' to exit.