This repository is a project for face recognition.
We provide all environment configurations in requirements.txt
. To install all packages, you can create a conda environment and install the packages as follows:
conda create -n face python=3.8
conda activate face
conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge
pip install -r requirements.txt
pip install dlib
pip install face_recognition
In our experiments, we used NVIDIA CUDA 11.3 on Ubuntu 20.04. Similar CUDA version should also be acceptable with corresponding version control for torch
and torchvision
.
Before you start training, you need to run data_process.py
to process the raw data. Remember to change the DATA_ROOT
to your own path.
To train the model from scratch, we provide the following script:
$ chmod +x train.sh
$ ./train.sh
Remember to change the data_root
and log_path
to your own path.
To reload checkpoints and only run inference, we provide the following script:
$ chmod +x test.sh
$ ./test.sh
We provide two checkpoints in ckpt
folder: train_val.ckpt
is trained on the whole dataset, and train.ckpt
is trained on the training dataset. You can change the test_ckpt_path
in test.sh
to reload the checkpoints. We provide all checkpoints at this link.
We also provide two types of evaluation: test
and val
. You can change the action
in test.sh
to choose the evaluation type.
Remember to change the data_root
and log_path
to your own path.
To test face recognition, you can run fr_acc.py
to get the accuracy of face recognition.
Remember to change the DATA_ROOT
to your own path.
This code used resources from BO-QSA. We thank the authors for open-sourcing their awesome projects.