1 Star 1 Fork 1

gdjmck/VGGFace2-pytorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

PyTorch Face Recognizer based on 'VGGFace2: A dataset for recognising faces across pose and age'.

This repo implements training and testing models, and feature extractor based on models for VGGFace2 [1].

Pretrained models for PyTorch are converted from Caffe models authors of [1] provide.

Dataset

To download VGGFace2 dataset, see authors' site.

Preprocessing images

Faces should be detected and cropped from images before face images are fed to this face recognizer(demo.py).

There are several face detection programs based on MTCNN [3].

Pretrained models

The followings are PyTorch models converted from Caffe models authors of [1] provide.

arch_type download link
resnet50_ft link
senet50_ft link
resnet50_scratch link
senet50_scratch link

Extracting features

Usage:

python demo.py extract <options>

Options

  • --arch_type network architecture type (default: resnet50_ft):
    • resnet50_ft ResNet-50 which are first pre-trained on MS1M, and then fine-tuned on VGGFace2
    • senet50_ft SE-ResNet-50 trained like resnet50_ft
    • resnet50_scratch ResNet-50 trained from scratch on VGGFace2
    • senet50_scratch SE-ResNet-50 trained like resnet50_scratch
  • --weight_file weight file converted from Caffe model(see here)
  • --resume checkpoint file used in feature extraction (default: None). If set, --weight_file is ignored.
  • --dataset_dir dataset directory
  • --feature_dir directory where extracted features are saved
  • --test_img_list_file image file for which features are extracted
  • --log_file log file
  • --meta_file Meta information file for VGGFace2, identity_meta.csv in Meta.tar.gz
  • --batch_size batch size (default: 32)
  • --gpu GPU devide id (default: 0)
  • --workers number of data loading workers (default: 4)
  • --horizontal_flip horizontally flip images specified in --test_img_list_file

Testing

Usage:

python demo.py test <options>

Options

  • --arch_type network architecture type (default: resnet50_ft):
    • resnet50_ft ResNet-50 which are first pre-trained on MS1M, and then fine-tuned on VGGFace2
    • senet50_ft SE-ResNet-50 trained like resnet50_ft
    • resnet50_scratch ResNet-50 trained from scratch on VGGFace2
    • senet50_scratch SE-ResNet-50 trained like resnet50_scratch
  • --weight_file weight file converted from Caffe model(see here)
  • --resume checkpoint file used in test (default: None). If set, --weight_file is ignored.
  • --dataset_dir dataset directory
  • --test_img_list_file text file containing image files used for validation, test or feature extraction
  • --log_file log file
  • --meta_file Meta information file for VGGFace2, identity_meta.csv in Meta.tar.gz
  • --batch_size batch size (default: 32)
  • --gpu GPU devide id (default: 0)
  • --workers number of data loading workers (default: 4)

Training

Usage:

python demo.py train <options>

Options

  • --arch_type network architecture type (default: resnet50_ft):
    • resnet50_ft ResNet-50 which are first pre-trained on MS1M, and then fine-tuned on VGGFace2
    • senet50_ft SE-ResNet-50 trained like resnet50_ft
    • resnet50_scratch ResNet-50 trained from scratch on VGGFace2
    • senet50_scratch SE-ResNet-50 trained like resnet50_scratch
  • --weight_file weight file converted from Caffe model(see here), and used for fine-tuning
  • --resume checkpoint file used to resume training (default: None). If set, --weight_file is ignored.
  • --dataset_dir dataset directory
  • --train_img_list_file text file containing image files used for training
  • --test_img_list_file text file containing image files used for validation, test or feature extraction
  • --log_file log file
  • --meta_file Meta information file for VGGFace2, identity_meta.csv in Meta.tar.gz
  • --checkpoint_dir checkpoint output directory
  • --config number of settings and hyperparameters used in training
  • --batch_size batch size (default: 32)
  • --gpu GPU devide id (default: 0)
  • --workers number of data loading workers (default: 4)

Note

VGG-Face dataset, described in [2], is not planned to be supported in this repo. If you are interested in models for VGG-Face, see keras-vggface.

References

  1. ZQ. Cao, L. Shen, W. Xie, O. M. Parkhi, A. Zisserman, VGGFace2: A dataset for recognising faces across pose and age, 2018.
    site, arXiv

  2. Parkhi, O. M. and Vedaldi, A. and Zisserman, A., Deep Face Recognition, British Machine Vision Conference, 2015. site

  3. K. Zhang and Z. Zhang and Z. Li and Y. Qiao, Joint Face Detection and Alignment Using Multitask Cascaded Convolutional Networks, IEEE Signal Processing Letters, 2016. arXiv

MIT License Copyright (c) 2018 cydonia Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

https://github.com/cydonia999/VGGFace2-pytorch 搬运工 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者 (1)

全部

近期动态

4年多前推送了新的提交到 dev 分支,f341317...d4c1e6e
4年多前推送了新的提交到 dev 分支,b1c456e...f341317
4年多前推送了新的提交到 dev 分支,6120141...b1c456e
4年多前推送了新的提交到 dev 分支,7ec25b9...6120141
4年多前推送了新的提交到 dev 分支,b7517a5...7ec25b9
加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gdjmck/VGGFace2-pytorch.git
git@gitee.com:gdjmck/VGGFace2-pytorch.git
gdjmck
VGGFace2-pytorch
VGGFace2-pytorch
master

搜索帮助