Files
insightface/detection/retinaface/README.md

85 lines
3.5 KiB
Markdown
Raw Normal View History

2019-05-03 13:03:55 +08:00
# RetinaFace Face Detector
## Introduction
2020-07-06 09:58:47 +01:00
RetinaFace is a practical single-stage [SOTA](http://shuoyang1213.me/WIDERFACE/WiderFace_Results.html) face detector which is initially introduced in [arXiv technical report](https://arxiv.org/abs/1905.00641) and then accepted by [CVPR 2020](https://openaccess.thecvf.com/content_CVPR_2020/html/Deng_RetinaFace_Single-Shot_Multi-Level_Face_Localisation_in_the_Wild_CVPR_2020_paper.html).
2019-05-03 13:03:55 +08:00
2021-06-19 23:37:10 +08:00
![demoimg1](https://insightface.ai/assets/img/github/11513D05.jpg)
2019-05-04 11:57:57 +01:00
2021-06-19 23:37:10 +08:00
![demoimg2](https://insightface.ai/assets/img/github/widerfacevaltest.png)
2019-05-03 13:10:28 +08:00
2019-05-04 11:53:59 +01:00
## Data
2019-05-03 13:03:55 +08:00
2021-08-05 10:33:35 +08:00
1. Download our annotations (face bounding boxes & five facial landmarks) from [baidu cloud](https://pan.baidu.com/s/1Laby0EctfuJGgGMgRRgykA) or [gdrive](https://drive.google.com/file/d/1BbXxIiY-F74SumCNG6iwmJJ5K3heoemT/view?usp=sharing)
2019-05-04 11:53:59 +01:00
2. Download the [WIDERFACE](http://shuoyang1213.me/WIDERFACE/WiderFace_Results.html) dataset.
3. Organise the dataset directory under ``insightface/RetinaFace/`` as follows:
2019-05-03 13:03:55 +08:00
```Shell
data/retinaface/
train/
images/
label.txt
val/
images/
label.txt
test/
images/
label.txt
```
2019-05-06 21:48:57 +08:00
## Install
1. Install MXNet with GPU support.
2019-05-06 17:25:04 +01:00
2. Install Deformable Convolution V2 operator from [Deformable-ConvNets](https://github.com/msracver/Deformable-ConvNets) if you use the DCN based backbone.
2019-05-06 21:48:57 +08:00
3. Type ``make`` to build cxx tools.
2019-05-04 11:53:59 +01:00
## Training
Please check ``train.py`` for training.
2019-05-06 17:25:04 +01:00
2019-05-04 19:30:15 +08:00
1. Copy ``rcnn/sample_config.py`` to ``rcnn/config.py``
2019-07-02 17:15:33 +08:00
2. Download ImageNet pretrained models and put them into ``model/``(these models are not for detection testing/inferencing but training and parameters initialization).
2019-05-06 17:27:21 +01:00
2019-05-06 17:29:29 +01:00
ImageNet ResNet50 ([baidu cloud](https://pan.baidu.com/s/1WAkU9ZA_j-OmzO-sdk9whA) and [dropbox](https://www.dropbox.com/s/48b850vmnaaasfl/imagenet-resnet-50.zip?dl=0)).
2019-05-06 17:27:21 +01:00
2019-05-06 17:29:29 +01:00
ImageNet ResNet152 ([baidu cloud](https://pan.baidu.com/s/1nzQ6CzmdKFzg8bM8ChZFQg) and [dropbox](https://www.dropbox.com/s/8ypcra4nqvm32v6/imagenet-resnet-152.zip?dl=0)).
2019-05-06 17:27:21 +01:00
2019-05-06 17:25:04 +01:00
3. Start training with ``CUDA_VISIBLE_DEVICES='0,1,2,3' python -u train.py --prefix ./model/retina --network resnet``.
Before training, you can check the ``resnet`` network configuration (e.g. pretrained model path, anchor setting and learning rate policy etc..) in ``rcnn/config.py``.
4. We have two predefined network settings named ``resnet``(for medium and large models) and ``mnet``(for lightweight models).
2019-05-04 11:53:59 +01:00
2019-05-03 13:03:55 +08:00
## Testing
2019-04-18 15:41:39 +08:00
2019-05-04 11:53:59 +01:00
Please check ``test.py`` for testing.
2019-07-02 17:15:33 +08:00
## RetinaFace Pretrained Models
2019-05-04 11:53:59 +01:00
2019-05-06 17:25:04 +01:00
Pretrained Model: RetinaFace-R50 ([baidu cloud](https://pan.baidu.com/s/1C6nKq122gJxRhb37vK0_LQ) or [dropbox](https://www.dropbox.com/s/53ftnlarhyrpkg2/retinaface-R50.zip?dl=0)) is a medium size model with ResNet50 backbone.
2019-05-04 11:53:59 +01:00
It can output face bounding boxes and five facial landmarks in a single forward pass.
2019-05-06 17:27:21 +01:00
2019-05-04 11:53:59 +01:00
WiderFace validation mAP: Easy 96.5, Medium 95.6, Hard 90.4.
To avoid the confliction with the WiderFace Challenge (ICCV 2019), we postpone the release time of our best model.
2019-04-18 15:41:39 +08:00
2019-05-10 13:21:29 +01:00
## Third-party Models
2019-05-10 13:14:07 +01:00
2020-10-31 23:03:18 +00:00
[yangfly](https://github.com/yangfly): RetinaFace-MobileNet0.25 ([baidu cloud](https://pan.baidu.com/s/1P1ypO7VYUbNAezdvLm2m9w):nzof).
2019-05-10 13:21:29 +01:00
WiderFace validation mAP: Hard 82.5. (model size: 1.68Mb)
2019-05-10 13:14:07 +01:00
2019-10-08 14:10:15 +01:00
[clancylian](https://github.com/clancylian/retinaface): C++ version
2019-05-04 12:57:51 +01:00
## References
2019-04-18 15:43:31 +08:00
2020-07-06 09:56:32 +01:00
```
@inproceedings{Deng2020CVPR,
title = {RetinaFace: Single-Shot Multi-Level Face Localisation in the Wild},
author = {Deng, Jiankang and Guo, Jia and Ververas, Evangelos and Kotsia, Irene and Zafeiriou, Stefanos},
2019-05-04 12:57:51 +01:00
booktitle = {CVPR},
2020-07-06 09:56:32 +01:00
year = {2020}
2019-05-04 12:57:51 +01:00
}
```
2019-04-18 17:58:26 +08:00