A PyTorch implementation of RetinaFace: Single-stage Dense Face Localisation in the Wild.
python train.py --network resnet50 --num_workers 1 --cpu_usage True
- git clone https://github.com/licksylick/retinaface_with_face_alignment.git
- Pytorch version 1.1.0+ and torchvision 0.3.0+ are needed
- Codes are based on Python 3
Link: from google cloud
Paste it to widerface dir
We provide restnet50 and mobilenet0.25 as backbone network to train model. We trained Mobilenet0.25 on imagenet dataset and get 46.58% in top 1. If you do not wish to train the model, we also provide trained model. Pretrain model and trained model are put in google cloud and baidu cloud Password: fstq . The model could be put as follows:
./weights/
mobilenet0.25_Final.pth
mobilenetV1X0.25_pretrain.tar
Resnet50_Final.pth
-
Before training, you can check network configuration (e.g. batch_size, min_sizes and steps etc..) in
data/config.py and train.py
. -
Train the model using WIDER FACE:
CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py --network resnet50 or
CUDA_VISIBLE_DEVICES=0 python train.py --network mobile0.25
- Generate txt file
python test_widerface.py --trained_model weight_file --network mobile0.25 or resnet50
- Evaluate txt results. Demo come from Here
cd ./widerface_evaluate
python setup.py build_ext --inplace
python evaluation.py
- You can also use widerface official Matlab evaluate demo in Here
- Download the images FDDB to:
./data/FDDB/images/
- Evaluate the trained model using:
python test_fddb.py --trained_model weight_file --network mobile0.25 or resnet50
- Download eval_tool to evaluate the performance.
@inproceedings{deng2019retinaface,
title={RetinaFace: Single-stage Dense Face Localisation in the Wild},
author={Deng, Jiankang and Guo, Jia and Yuxiang, Zhou and Jinke Yu and Irene Kotsia and Zafeiriou, Stefanos},
booktitle={arxiv},
year={2019}