Package: retinaface-py
RetinaFace in PyTorchAPyTorchimplementation ofRetinaFace: Single-stage Dense Face Localisation in the Wild. Model size only 1.7M, when Retinaface use mobilenet0.25 as backbone net. We also provide resnet50 as backbone net to get better result. The official code in Mxnet can be foundhere.Mobile or Edge device deployWe also provide a set of Face Detector for edge device inherefrom python training to C++ inference.WiderFace Val Performance in single scale When using Resnet50 as backbone net.StyleeasymediumhardPytorch (same parameter with Mxnet)94.82 %93.84%89.60%Pytorch (original image scale)95.48%94.04%84.43%Mxnet94.86%93.87%88.33%Mxnet(original image scale)94.97%93.89%82.27%WiderFace Val Performance in single scale When using Mobilenet0.25 as backbone net.StyleeasymediumhardPytorch (same parameter with Mxnet)88.67%87.09%80.99%Pytorch (original image scale)90.70%88.16%73.82%Mxnet88.72%86.97%79.19%Mxnet(original image scale)89.58%87.11%69.12%FDDB Performance.FDDB(pytorch)performanceMobilenet0.2598.64%Resnet5099.22%ContentsInstallationTrainingEvaluationTensorRTReferencesInstallationClone and installgit clonehttps://github.com/biubug6/Pytorch_Retinaface.gitPytorch version 1.1.0+ and torchvision 0.3.0+ are needed.Codes are based on Python 3DataDownload theWIDERFACEdataset.Download annotations (face bounding boxes & five facial landmarks) frombaidu cloudordropboxOrganise the dataset directory as follows:./data/widerface/train/images/label.txtval/images/wider_val.txtps: wider_val.txt only include val file names but not label information.Data1We also provide the organized dataset we used as in the above directory structure.Link: fromgoogle cloudorbaidu cloudPassword: ruckTrainingWe 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 ingoogle cloudandbaidu cloudPassword: fstq . The model could be put as follows:./weights/mobilenet0.25_Final.pthmobilenetV1X0.25_pretrain.tarResnet50_Final.pthBefore training, you can check network configuration (e.g. batch_size, min_sizes and steps etc..) indata/config.py and train.py.Train the model using WIDER FACE:CUDA_VISIBLE_DEVICES=0,1,2,3pythontrain.py--networkresnet50orCUDA_VISIBLE_DEVICES=0pythontrain.py--networkmobile0.25EvaluationEvaluation widerface valGenerate txt filepythontest_widerface.py--trained_modelweight_file--networkmobile0.25orresnet50Evaluate txt results. Demo come fromHerecd./widerface_evaluate
pythonsetup.pybuild_ext--inplace
pythonevaluation.pyYou can also use widerface official Matlab evaluate demo inHereEvaluation FDDBDownload the imagesFDDBto:./data/FDDB/images/Evaluate the trained model using:pythontest_fddb.py--trained_modelweight_file--networkmobile0.25orresnet50Downloadeval_toolto evaluate the performance.TensorRT-TensorRTReferencesFaceBoxesRetinaface (mxnet)@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}