End2End Occluded Face Recognition by Masking Corrupted Features
This is the Pytorch implementation of our TPAMI 2021 paper End2End Occluded Face Recognition by Masking Corrupted Features.
Haibo Qiu, Dihong Gong, Zhifeng Li, Wei Liu and Dacheng Tao
Requirements
Main packages:
- python=3.6.7
- pytorch=1.8.1
- torchvision=0.9.1
- cudatoolkit=10.2.89
- lmdb=1.2.0
- pyarrow=0.17.0
Or directly create a conda env with
conda env create -f environment.yml
Data preparation
-
Training data (
data/datasets
) and pretrained models (pretrained/
) can be found here. -
Please refer to
data/generate_lmdb.py
for the lmdb file generation of training data. -
Please refer to
data/generate_occ_lfw.py
for the occluded testing images generation.
Training
Simply run the following script:
bash start.sh
Testing
- To reproduce the results in our paper, please download the pretrained models and put them in
pretrained/
, then run:
bash eval.sh
-
For megaface testing, the related commonds are included in
eval.sh
. Currentlib/core/megaface_mp.py
generates npy file for each sample, which can be evaluated with FaceX-Zoo. Or you can switch the generated function inlib/core/megaface_mp.py
to produce bin file and use official devkit for evaluation. -
The AR Face dataset evaluation scripts are also included in
eval.sh
Acknowledgement
The code is partially developed from PDSN. The occluders images are also from PDSN.
Citation
If you use our code or models in your research, please cite with:
@article{qiu2021end2end,
title={End2End occluded face recognition by masking corrupted features},
author={Qiu, Haibo and Gong, Dihong and Li, Zhifeng and Liu, Wei and Tao, Dacheng},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
year={2021},
publisher={IEEE}
}