Pytorch0.4.1 codes for InsightFace
- This repo is a reimplementation of Arcface(paper), or Insightface(github)
- For models, including the pytorch implementation of the backbone modules of Arcface and MobileFacenet
- Codes for transform MXNET data records in Insightface(github) to Image Datafolders are provided
- Pretrained models are posted, include the MobileFacenet and IR-SE50 in the original paper
IR-SE50 @ BaiduNetdisk, IR-SE50 @ Onedrive
LFW(%) | CFP-FF(%) | CFP-FP(%) | AgeDB-30(%) | calfw(%) | cplfw(%) | vgg2_fp(%) |
---|---|---|---|---|---|---|
0.9952 | 0.9962 | 0.9504 | 0.9622 | 0.9557 | 0.9107 | 0.9386 |
Mobilefacenet @ BaiduNetDisk, Mobilefacenet @ OneDrive
LFW(%) | CFP-FF(%) | CFP-FP(%) | AgeDB-30(%) | calfw(%) | cplfw(%) | vgg2_fp(%) |
---|---|---|---|---|---|---|
0.9918 | 0.9891 | 0.8986 | 0.9347 | 0.9402 | 0.866 | 0.9100 |
-
clone
git clone https://github.com/TropComplique/mtcnn-pytorch.git
Provide the face images your want to detect in the data/face_bank folder, and guarantee it have a structure like following:
data/facebank/
---> id1/
---> id1_1.jpg
---> id2/
---> id2_1.jpg
---> id3/
---> id3_1.jpg
---> id3_2.jpg
If more than 1 image appears in one folder, an average embedding will be calculated
download the refined dataset: (emore recommended)
- emore dataset @ BaiduDrive, emore dataset @ Dropbox
- More Dataset please refer to the original post
Note: If you use the refined MS1M dataset and the cropped VGG2 dataset, please cite the original papers.
-
after unzip the files to 'data' path, run :
python prepare_data.py
after the execution, you should find following structure:
faces_emore/
---> agedb_30
---> calfw
---> cfp_ff
---> cfp_fp
---> cfp_fp
---> cplfw
--->imgs
---> lfw
---> vgg2_fp
-
- download the desired weights to model folder:
-
- or you can put any preexisting photo into the facebank directory, the file structure is as following:
- facebank/
name1/
photo1.jpg
photo2.jpg
...
name2/
photo1.jpg
photo2.jpg
...
.....
if more than 1 image appears in the directory, average embedding will be calculated
-
- To update known faces
python face_verify.py -c -i ../dataset/9.jpg
-
- To test
python face_verify.py -c -i ../dataset/9.jpg
```
python train.py -b [batch_size] -lr [learning rate] -e [epochs]
# python train.py -net mobilefacenet -b 200 -w 4
```
- This repo is mainly inspired by deepinsight/insightface and InsightFace_TF