人脸检测: 由原来的retina改成了MTCNN,准确度差了不少
人脸对齐: 由原来的Dense U-Net改成了MTCNN
人脸识别: 当前可以支持mobilefacenet和resnet50-irse两种
insightface_pytorch实现人脸识别包含两个步骤,第一步人脸检测和人脸对齐,第二步人脸识别
人脸检测(face detection)和人脸对齐(face alignment):使用基于MTCNN网络的开源项目mtcnn-pytorch,经过实测比retina要差很多
人脸识别(face recognition):人脸识别提供了多种模型mobilefacenet,retnet50-irse等网络的预训练模型和网络结构
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 |
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)
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
IR-SE50 @ BaiduNetdisk
IR-SE50 @ Onedrive
Mobilefacenet @ BaiduNetDisk
Mobilefacenet @ OneDrive
python take_pic.py -n name
press q to take a picture, it will only capture 1 highest possibility face if more than 1 person appear in the camera
- 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
python face_verify.py
```
python infer_on_video.py -f [video file name] -s [save file name]
```
the video file should be inside the data/face_bank folder
```
python train.py -b [batch_size] -lr [learning rate] -e [epochs]
# python train.py -net mobilefacenet -b 200 -w 4
```
对于工程的理解,应该是重点改进点在recognition上面。 这里需要知道人脸识别的几个模块。detection, alignment, verification ,identification/recognition . 所以,本工程的重点算法的改进在于recognition。而其它的模块,比如detection,可能就直接使用MTCNN。
对于工程的使用,主要是按照要求,组建好环境后,./recognition里 config.py里更改 dataset ,数据集, batchsize与gpu个数相关,然后去dataset-zoo下载了数据集后,开始训练,这样就生成了model ,model的生成位置也是在config.py里配置。在训练的过程中,也看到了verification.
如果你懒得去训练,直接使用pre-train model 。可以去文中讲的model-zoo里去下载; 认真点的,可以再使用verification.py
src/eval/verification.py验证其精度,不认真的,直接拿去使用吧。