# ArcFace in MindSpore
<div align="center">
English | [简体中文](README_zh-CN.md)
</div>
## Introduction
MindSpore is a new generation of full-scenario AI computing framework launched by Huawei in August 2019 and released On March 28, 2020.
This repository is the mindspore implementation of ArcFace and has achieved great performance. We implemented two versions based on ResNet and MobileNet to meet different needs.
<div align="center"><img src="image/arcface.png" width="600" ></div>
## Updates!!
+ 【2022/12/20】 vit tiny/small/base/large backbone are supported.
+ 【2022/09/24】 We upload ArcFace based on MindSpore and update the result of eval dataset.
+ 【2022/06/18】 We create this repository.
## Performance on lfw, cfp_fp, agedb_30, calfw and cplfw
## 1. Training on Multi-Host GPU
| Datasets | Backbone | lfw | cfp_fp | agedb_30 | calfw | cplfw |
|:---------------|:--------------------|:------------|:------------|:------------|:------------|:------------|
| CASIA | mobilefacenet-0.45g | 0.98483+-0.00425 | 0.86843+-0.01838 | 0.90133+-0.02118 | 0.90917+-0.01294 | 0.81217+-0.02232 |
| CASIA | r50 | 0.98667+-0.00435 | 0.90357+-0.01300 | 0.91750+-0.02277 | 0.92033+-0.01122 | 0.83667+-0.01719 |
| CASIA | r100 | 0.98950+-0.00366 | 0.90943+-0.01300 | 0.91833+-0.01655 | 0.92433+-0.01017 | 0.84967+-0.01904 |
| CASIA | vit-t | 0.98400+-0.00704 | 0.83229+-0.01877 | 0.87283+-0.02468 | 0.90667+-0.00934 | 0.80700+-0.01767 |
| CASIA | vit-s | 0.98550+-0.00806 | 0.85557+-0.01617 | 0.87850+-0.02194 | 0.91083+-0.00876 | 0.82500+-0.01685 |
| CASIA | vit-b | 0.98333+-0.00553 | 0.85829+-0.01836 | 0.87417+-0.01838 | 0.90800+-0.00968 | 0.81400+-0.02236 |
| CASIA | vit-l | 0.97600+-0.00898 | 0.84543+-0.01718 | 0.85317+-0.01411 | 0.89733+-0.00910 | 0.79550+-0.01648 |
| MS1MV2 | mobilefacenet-0.45g| 0.98700+-0.00364 | 0.88214+-0.01493 | 0.90950+-0.02076 | 0.91750+-0.01088 | 0.82633+-0.02014 |
| MS1MV2 | r50 | 0.99767+-0.00260 | 0.97186+-0.00652 | 0.97783+-0.00869 | 0.96067+-0.01121 | 0.92033+-0.01732 |
| MS1MV2 | r100 | 0.99383+-0.00334 | 0.96800+-0.01042 | 0.93767+-0.01724 | 0.93267+-0.01327 | 0.89150+-0.01763 |
| MS1MV2 | vit-t | 0.99717+-0.00279 | 0.92714+-0.01389 | 0.96717+-0.00727 | 0.95600+-0.01198 | 0.89950+-0.01291 |
| MS1MV2 | vit-s | 0.99767+-0.00260 | 0.95771+-0.01058 | 0.97617+-0.00972 | 0.95800+-0.01142 | 0.91267+-0.01104 |
| MS1MV2 | vit-b | 0.99817+-0.00252 | 0.94200+-0.01296 | 0.97517+-0.00858 | 0.96000+-0.01179 | 0.90967+-0.01152 |
| MS1MV2 | vit-l | 0.99750+-0.00291 | 0.93714+-0.01498 | 0.96483+-0.01031 | 0.95817+-0.01158 | 0.90450+-0.01062 |
## Pretained models
You can download the pretrained models from [baidu cloud](https://pan.baidu.com/s/1iLw5kOt4Bzr5slA2L9yG_A?pwd=3ggw) or [googledrive](https://drive.google.com/drive/folders/1VoaRX2hpbnC0D1pQ7ex1Trp2EpbYlcAj?usp=sharing) .
You can reproduce the results in the table above with the downloaded pretrained model.
## Quick Start
<summary>Installation</summary>
Step1. Git clone this repo
```shell
git clone https://github.com/mindspore-lab/mindface.git
```
Step2. Install dependencies
```shell
cd mindface
pip install -r requirements.txt
```
<summary>Prepare Data</summary>
Step1. Prepare and Download the dataset
- [CASIA](https://github.com/deepinsight/insightface/tree/master/recognition/_datasets_#casia-webface-10k-ids05m-images-1) (10K ids/0.5M images)
- [MS1MV2](https://github.com/deepinsight/insightface/tree/master/recognition/_datasets_#ms1m-arcface-85k-ids58m-images-57) (87k IDs, 5.8M images)
Step2. Convert the dataset from rec format to jpg format
```python
cd mindface/recognition
python utils/rec2jpg_dataset.py --include the/path/to/rec --output output/path
```
<summary>Train and Eval</summary>
The example commands below show how to run distributed training.
Step1. Train
```shell
# Distributed training example
bash scripts/run_distribute_train.sh rank_size /path/dataset
```
Step2. Eval
```shell
# Evaluation example
bash scripts/run_eval.sh /path/evalset /path/ckpt
```
<summary>Tutorials</summary>
- [Getting Started](../../tutorials/detection/get_started.md)
- [Learn about recognition configs](../../tutorials/detection/config.md)
- [Learn to reproduce the eval result and inference with a pretrained model](../../tutorials/recognition/inference.md)
- [Learn about how to create dataset](../../tutorials/recognition/dataset.md)
- [Learn about how to train/finetune a model](../../tutorials/recognition/finetune.md)
- [Learn about how to use the loss function](../../tutorials/recognition/loss.md)
- [Learn about how to create model and custom model](../../tutorials/recognition/model.md)
## Citations
```
@inproceedings{deng2019arcface,
title={Arcface: Additive angular margin loss for deep face recognition},
author={Deng, Jiankang and Guo, Jia and Xue, Niannan and Zafeiriou, Stefanos},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={4690--4699},
year={2019}
}
@inproceedings{An_2022_CVPR,
author={An, Xiang and Deng, Jiankang and Guo, Jia and Feng, Ziyong and Zhu, XuHan and Yang, Jing and Liu, Tongliang},
title={Killing Two Birds With One Stone: Efficient and Robust Training of Face Recognition CNNs by Partial FC},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month={June},
year={2022},
pages={4042-4051}
}
@inproceedings{zhu2021webface260m,
title={Webface260m: A benchmark unveiling the power of million-scale deep face recognition},
author={Zhu, Zheng and Huang, Guan and Deng, Jiankang and Ye, Yun and Huang, Junjie and Chen, Xinze and Zhu, Jiagang and Yang, Tian and Lu, Jiwen and Du, Dalong and Zhou, Jie},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={10492--10502},
year={2021}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
基于MindSpore的开源工具包,包含最先进的人脸识别和检测模型
共134个文件
py:71个
md:23个
yaml:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 44 浏览量
2023-04-16
09:48:18
上传
评论 1
收藏 851KB ZIP 举报
温馨提示
MindFace是一款基于MindSpore的开源工具包,包含最先进的人脸识别和检测模型,如ArcFace、RetinaFace和其他模型,主要用于面部识别和检测等常见应用场景
资源推荐
资源详情
资源评论
收起资源包目录
基于MindSpore的开源工具包,包含最先进的人脸识别和检测模型 (134个子文件)
make.bat 764B
pylint.conf 11KB
0000_pred.jpg 280KB
0000.jpg 144KB
Makefile 638B
finetune.md 14KB
LICENSE.md 11KB
infer.md 10KB
inference.md 8KB
config.md 7KB
README.md 6KB
README_zh-CN.md 6KB
README.md 6KB
README_zh-CN.md 5KB
get_started.md 5KB
dataset.md 3KB
finetune.md 3KB
loss.md 3KB
config.md 2KB
model.md 2KB
get_started.md 2KB
get_started_CN.md 2KB
bug-report.md 1KB
feature_request.md 716B
README.md 445B
readme.md 20B
docs.md 0B
docs.md 0B
arcface.png 283KB
engine.py 17KB
val.py 14KB
retinaface.py 14KB
eval.py 12KB
vit.py 12KB
augmentation.py 11KB
train_cfg2.py 9KB
iresnet.py 9KB
train_cfg.py 9KB
dataset.py 8KB
resnet.py 8KB
train.py 8KB
eval.py 8KB
mobilefacenet.py 7KB
adamw.py 7KB
box_utils.py 6KB
adan.py 6KB
train.py 6KB
optim_factory.py 6KB
loss.py 5KB
infer.py 5KB
nadam.py 4KB
mobilenet.py 3KB
lr_schedule.py 3KB
face_dataset.py 3KB
setup.py 3KB
conf.py 2KB
helper.py 2KB
utils.py 2KB
test_infer.py 2KB
test_infer.py 2KB
infer.py 2KB
test_loss.py 2KB
ce_loss.py 2KB
__init__.py 1KB
test_models.py 1KB
test_models.py 1KB
rec2jpg_dataset.py 1KB
arcface_loss.py 1KB
test_loss.py 1KB
partial_fc.py 1KB
wrapper.py 874B
train_config_casia_mobile.py 856B
train_config_casia_r100.py 851B
train_config_casia_r50.py 849B
train_config_ms1mv2_mobile.py 844B
train_config_ms1mv2_r100.py 840B
train_config_ms1mv2_r50.py 838B
train_config_casia_vit_t.py 817B
train_config_casia_vit_s.py 817B
train_config_ms1mv2_vit_t.py 808B
train_config_ms1mv2_vit_s.py 808B
train_config_casia_vit_b.py 803B
train_config_casia_vit_l.py 799B
train_config_ms1mv2_vit_b.py 793B
train_config_ms1mv2_vit_l.py 750B
__init__.py 274B
__init__.py 185B
__init__.py 143B
__init__.py 142B
__init__.py 110B
__init__.py 78B
__init__.py 78B
version.py 41B
__init__.py 41B
__init__.py 40B
__init__.py 36B
__init__.py 34B
__init__.py 11B
__init__.py 11B
__init__.py 0B
共 134 条
- 1
- 2
资源评论
- 信仰2024-04-18资源很受用,资源主总结的很全面,内容与描述一致,解决了我当下的问题。
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6705
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功