Retinaface model trained on WiderFace
Retinaface trained on WiderFace dataset at resolution 640x640, when Retinaface use mobilenet0.25 as backbone net. It was introduced in the paper RetinaFace: Single-stage Dense Face Localisation in the Wild by Jiankang Deng et al. The code version we use from this repository.
We develop a modified version that could be supported by AMD Ryzen AI.
Model description
Retinaface is an advanced algorithm used for face detection and facial keypoint localization. It is based on deep learning techniques and is capable of accurately detecting faces in images and providing precise positioning of facial landmarks.
Intended uses & limitations
You can use the raw model for Face detection. See the model hub to look for all available Retinaface models.
How to use
Installation
Follow Ryzen AI Installation to prepare the environment for Ryzen AI. Run the following script to install pre-requisites for this model.
pip install -r requirements.txt
Data Preparation (optional: for accuracy evaluation)
- Download the WIDERFACE dataset.
- Organise the dataset directory as follows:
(Note:
train
andtest
are not necessary for accuracy evaluation on validation set. wider_val.txt only include val file names but not label information.)
./data/widerface/
val/
images/
wider_val.txt
Test & Evaluation
- Run inference for a single image
python widerface_onnx_inference.py -m .\weights\RetinaFace_int.onnx --image_path \WIDERFACE_VAL_IMAGE_PAT --ipu --provider_config Path\To\vaip_config.json
#return three lists: boxes, confs, landms
#if you want to change the image path, please select another image from widerface val dataset, set --image_path new_image_path
Note: vaip_config.json is located at the setup package of Ryzen AI (refer to Installation)
- Test accuracy of the quantized model
- Generate txt file
python widerface_onnx_evalute.py --ipu --provider_config Path\To\vaip_config.json
- Evaluate txt results. Demo come from Here
cd ./widerface_evaluate
python evaluation.py #please modify the evaluation path
Performance
Model | easy | medium | hard |
---|---|---|---|
RetinaFace_onnx_model (608x640) | 88.55% | 82.17% | 52.21% |
@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}