内容来源:https://github.com/XiaohangZhan/face_recognition_framework

基于PyTorch的人脸识别框架

Face recognition framework based on PyTorch.

一、介绍

This is a face recognition framework based on PyTorch with convenient training, evaluation and feature extraction functions. It is originally a multi-task face recognition framework for our accpeted ECCV 2018 paper, "Consensus-Driven Propagation in Massive Unlabeled Data for Face Recognition". However, it is also a common framework for face recognition. You can freely customize your experiments with your data and configurations with it.

这是一个基于PyTorch的人脸识别框架,具有便捷训练、评估和特征提取功能。 它最初是我们已被ECCV 2018接收的论文“Consensus-Driven Propagation in Massive Unlabeled Data for Face Recognition”的多任务人脸识别框架。 但是,它也是人脸识别的通用框架。 您可以使用您的数据和配置自由定制您的实验。

二、文章

Xiaohang Zhan, Ziwei Liu, Junjie Yan, Dahua Lin, Chen Change Loy, "Consensus-Driven Propagation in Massive Unlabeled Data for Face Recognition", ECCV 2018

工程链接:Consensus-Driven Propagation in Massive Unlabeled Data for Face Recognition

三、为什么要多任务?Why multi-task?

Different datasets have different identity (category) sets. We do not know the intersection between them. Hence instead of merging identity sets of different datasets, regarding them as different tasks is an effective alternative way.

不同的数据集有不同的身份(类别)集。 我们不知道它们之间的交集。 因此,我们没有合并不同数据集的身份集,而是将它们视为不同的任务,这也是一种有效的替代方法。

四、特色Features

Framework: Multi-task, Single Task

Loss: Softmax Loss, ArcFace

Backbone CNN: ResNet, DenseNet, Inception, InceptionResNet, NASNet, VGG

Benchmarks: Megaface (FaceScrub), IJB-A, LFW, CFP-FF, CFP-FP, AgeDB-30, calfw, cplfw

Data aug: flip, scale, translation

Online testing and visualization with Tensorboard.

框架:多任务,单任务

损失:Softmax Loss,ArcFace

主干 CNN:ResNet、DenseNet、Inception、InceptionResNet、NASNet、VGG

基准数据集:Megaface (FaceScrub)、IJB-A、LFW、CFP-FF、CFP-FP、AgeDB-30、calfw、cplfw

数据增强:翻转、缩放、平移

使用 Tensorboard 进行在线测试和可视化。

五、设置步骤

1、克隆项目Clone the project.

git clone git@github.com:XiaohangZhan/face_recognition_framework.git
cd face_recognition_framework

2、依赖库Dependency.

python=3.6, tensorboardX, pytorch=0.3.1, mxnet, sklearn

3、数据集准备Data Preparation.

Download datasets from insightface into your data storage folder, e.g., ~/data/face_recognition/. Taking CASIA-Webface for example:

从insightface下载数据集到你的数据存储文件夹,例如~/data/face_recognition/。

以CASIA-Webface为例:

cd ~/data/face_recognition/
mkdir -p megaface_test/raw
cd megaface_test/raw
mv ../../megaface_testpack_v1.0.zip .
unzip -q megaface_testpack_v1.0.zip
cd $THIS_REPO # back to the repo root
ln -s  ~/data/face_recognition/megaface_test data/megaface_test

Optionally, if you want to test on MegaFace. Download testing set from here into your data storage folder, e.g., ~/data/face_recognition/. Then:

或者,如果您想在 MegaFace 上进行测试。 从这里将测试集下载到您的数据存储文件夹中,例如 ~/data/face_recognition/。 然后:

cd ~/data/face_recognition/
mkdir -p megaface_test/raw
cd megaface_test/raw
mv ../../megaface_testpack_v1.0.zip .
unzip -q megaface_testpack_v1.0.zip
cd $THIS_REPO # back to the repo root
ln -s  ~/data/face_recognition/megaface_test data/megaface_test

Next, download MegaFace lists from here into ~/data/face_recognition/megaface_test/. Finally, the folder data/megaface_test/ looks like:

接下来,从这里下载 MegaFace 列表到 ~/data/face_recognition/megaface_test/。

最后,文件夹 data/megaface_test/ 是以下格式:

data
  ├── megaface_test
    ├── concat_list.txt
    ├── facescrub3530
    ├── megaface_distractor
    ├── raw

4、训练Training.

sh experiments/webface/res50-bs64-sz224-ep35/train.sh

5、监测Monitoring.

tensorboard --logdir experiments

6、恢复训练Resume training.

sh experiments/webface/res50-bs64-sz224-ep35/resume.sh 10 # e.g., resume from epoch 10

7、评估Evalution.

sh experiments/webface/res50-bs64-sz224-ep35/evaluation.sh 35 # e.g., evaluate epoch 35

8、特征值提取Feature extraction.

Firstly, specify the data_namedata_root and data_list under extract_info in the config file. The data_list is a txt file containing an image relative filename in each line. Then execute:

首先在配置文件extract_info下指定data_name、data_root和data_list。 data_list 是一个 txt 文件,每行包含一个图像相关文件名。 然后执行:

# e.g., extract features with epoch 35 model.
# The feature file is stored in checkpoints/ckpt_epoch_35_[data_name].bin
sh experiments/webface/res50-bs64-sz224-ep35/extract.sh 35

六、Baselines

1、Trained using Webface

arch LFW CFP-FF CFP-FP AgeDB-30 calfw cplfw
resnet-50 0.9850 0.9804 0.9117 0.8967 0.9013 0.8423

2、Trained using MS1M

arch LFW CFP-FF CFP-FP AgeDB-30 calfw cplfw vgg2-FP megaface
densenet-121 0.9948 0.9946 0.9594 0.9615 0.9500 0.9057 0.9418 0.8665
densenet-121-arc 0.9973 0.9979 0.9601 0.9728 0.9558 0.9063 0.9496 0.9287

Note that the hyper-parameters are not adjusted to optimal. Hence, they are not the state-of-the-art face recognition models. You may download those pre-trained models here.

请注意,超参数未调整为最佳。 因此,它们不是最先进的人脸识别模型。 您可以在此处下载这些预训练模型。

七、引用

If you find this code useful in your research, please cite:

@inproceedings{zhan2018consensus,
  title={Consensus-Driven Propagation in Massive Unlabeled Data for Face Recognition},
  author={Zhan, Xiaohang and Liu, Ziwei and Yan, Junjie and Lin, Dahua and Change Loy, Chen},
  booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
  pages={568--583},
  year={2018}
}

八、待续

TODO (Will carry out in a "Buddha-like" way)

  1. Implement distributed training.
  2. Adjust hyper-parameters.
  3. Multi-task experiments.

TODO(会以“佛性”的方式进行)
1、实施分布式训练。
2、调整超参数。
3、多任务实验。

基于PyTorch的人脸识别框架(翻译)相关推荐

  1. 基于pytorch的人脸识别脚本(python示例)

    示例1 import torch import torch.nn as nn import torch.optim as optim import torchvision.transforms as ...

  2. 港中文开源基于PyTorch的多任务人脸识别框架

    点击我爱计算机视觉标星,更快获取CVML新技术 今天跟大家分享一款新晋开源的出自香港中文大学MMLab实验室的人脸识别库,其最大特点是支持人脸多任务训练,方便使用PyTorch进行人脸识别的训练.评估 ...

  3. CVPR 2020 | 元学习人脸识别框架详解

    2020-05-15 23:07:48 本文介绍的是CVPR2020 oral论文<Learning Meta FaceRecognition in Unseen Domains(MFG[1]) ...

  4. 基于matlab的人脸五官边缘检测方法,基于MATLAB的人脸识别系统的设计

    基于MATLAB的人脸识别系统的设计(论文12000字,外文翻译,参考程序) 摘要:本文基于MATLAB平台设计了一款简单的人脸识别系统,通过USB摄像头来采集图像,经过肤色方法进行人脸检测与定位,然 ...

  5. 【计算机视觉】基于OpenCV的人脸识别

    一点背景知识 OpenCV 是一个开源的计算机视觉和机器学习库.它包含成千上万优化过的算法,为各种计算机视觉应用提供了一个通用工具包.根据这个项目的关于页面,OpenCV 已被广泛运用在各种项目上,从 ...

  6. cvpr2020 人脸检测与识别_CVPR 2020 | 元学习人脸识别框架详解

    本文介绍的是CVPR2020 oral论文<Learning Meta FaceRecognition in Unseen Domains(MFG[1])>,作者来自明略科技集团明略科学院 ...

  7. 基于 PCA 的人脸识别系统及人脸姿态分析

    文章目录 1 PCA 1.1 原理 1.2 算法流程 1.2.1 零均值化 1.2.2 计算协方差矩阵 1.2.3 特征值和特征向量 1.2.4 降维得到 K 维特征 1.2.5 PCA 的优缺点 2 ...

  8. 基于MATLAB的人脸识别系统

    基于MATLAB的人脸识别系统 一.课题背景 自70年代以来.随着人工智能技术的兴起.以及人类视觉研究的进展.人们逐渐对人脸图像的机器识别投入很大的热情,并形成了一个人脸图像识别研究领域,.这一领域除 ...

  9. 基于Python的人脸识别课堂考勤系统(毕设)

    一个菜鸟搞毕业设计的过程分享,可能对迷茫的你起到一点点作用! 序言 在着手开发项目之前我们一定要对系统进行一个初步的规划,比如系统可以实现什么功能,是否需要开发GUI页面(大部分导师都会让你搞一个,仅 ...

最新文章

  1. P1967 货车运输
  2. FSM(状态机)、HFSM(分层状态机)、BT(行为树)的区别
  3. opencv java 显示图片_【opencv三】利用opencv读取显示图片
  4. 阿里云Lindorm联合智臾科技发布,金融高频交易数据量化分析与处理方案
  5. xcode清除最近打开的文件列表
  6. 【UI】为项目添加类似于淘宝筛选列表勾选的ui-choose
  7. python 连接MYSQL数据库(入门帖)
  8. IP基础及ping命令
  9. MFC(6)点击按钮弹出新的对话框源码
  10. 实现京东商城手机注册获取验证码
  11. 阿里的花名,是要抹去员工独立人格?
  12. 爬虫--Item Pipeline 介绍(21)
  13. 22.1.11京东大数据实习面试
  14. mysql主从配置干什么_mysql主从配置之slave_exec_mode=IDEMPOTENT详解
  15. 消防工程师答题做试题模拟真题微信小程序,margin:25px 50px 75px 100px;
  16. 人民币升值会给我们带来什么(个人收藏)
  17. 人工神工机器人是什么_全球首台“纯意念控制”机器人在津发布
  18. 16、Python小案例
  19. linux下 firefox安装flash插件
  20. BZOJ4424: Cf19E Fairy

热门文章

  1. jonathonf/python-3.6/ubuntu xenial/main amd64 Packages 403 Forbidden 解决
  2. SQL常用基础语句总结
  3. FPGA市场现状和未来趋势
  4. talent 命令_telnet 命令使用方法详解,telnet命令怎么用?
  5. HDU--5575、Discover Water Tank (思维、优先队列)
  6. nodejs借助scp2依赖实现windows传输文件到linux
  7. speedoffice(Excel)表格如何修改字体颜色?
  8. USB4规范解读(三):深入了解USB4的系统结构和工作原理
  9. thinkphp 框架自动加载原理_thinkPHP5.0框架自动加载机制分析
  10. goahead(嵌入式Web服务器)之交叉编译、移植篇