The Mxnet implementation of the most recent state-of-the-art 2D and 3D face alignment method Stacked Dense U-Nets with Dual Transformers for Robust Face Alignment
at BMVC or link at Arxiv. This proposed stacked dense U-Nets (SDU-Net) with dual transformers can get the normalised mean error (NME) of 6.73% and 5.55% respectively on IBUG and COFW datasets for 2D face alignment. For 3D face alignment, this method further decreases the NME by 5.8% with former state-of-the-art method (HPM) proposed by Bulat et al on AFLW2000-3D.
Some popular heatmap based approaches like stacked hourglass are also provided in this repository.
The training/validation dataset and testset are in below table:
Data | Download Link | Description |
---|---|---|
bmvc_sdu_data2d.zip | BaiduCloud or GoogleDrive, 490M | 2D training/validation dataset and IBUG, COFW, 300W testset |
bmvc_sdu_data3d.zip | BaiduCloud or GoogleDrive, 1.54G | 3D training/validation dataset and AFLW2000-3D testset |
The performances of pre-trained models are shown below. Accuracy is reported as the Normalised Mean Error (NME). To facilitate comparison with other methods on these datasets, we give mean error normalised by the diagonal of the ground truth bounding box and the eye centre distance. Each training model is denoted by Topology^StackBlock (d = DownSampling Steps) - BlockType - OtherParameters.
Model | Model Size | IBUG | COFW | 300W | Download Link |
---|---|---|---|---|---|
Hourglass2(d=3)-CAB | 37MB | 1.891/7.207 | 1.962/6.125 | 1.651/5.792 | BaiduCloud or GoogleDrive |
Hourglass2(d=3)-CAB-DCN | BaiduCloud or GoogleDrive | ||||
Hourglass2(d=4)-Resnet | BaiduCloud or GoogleDrive | ||||
Hourglass2(d=3)-HPM | BaiduCloud or GoogleDrive | ||||
SAT2(d=3)-CAB | BaiduCloud or GoogleDrive |
Note: More pretrained models will be added soon.
This repository has been tested under the following environment:
- Python 2.7
- Ubuntu 18.04
- Mxnet-cu90 (==1.3.0)
-
Prepare the environment.
-
Clone the repository.
-
Download the training/validation dataset and unzip it to your project directory.
-
You can define different loss-type/network structure/dataset in
config.py
(fromsample_config.py
). -
You can use
CUDA_VISIBLE_DEVICES='0' train.py --network sdu
to train SDU-net orCUDA_VISIBLE_DEVICES='0' train.py --network hourglass
to train stacked hourglass network. Instead, you can also edittrain.sh
and runsh ./train.sh
to train your models.
-
Download the pre-trained model and place it in
./models/
. -
You can use
python test.py
to test this alignment method.
MIT LICENSE
@article{guo2018stacked,
title={Stacked Dense U-Nets with Dual Transformers for Robust Face Alignment},
author={Guo, Jia and Deng, Jiankang and Xue, Niannan and Zafeiriou, Stefanos},
journal={arXiv preprint arXiv:1812.01936},
year={2018}
}
The code is adapted based on an intial fork from the insightface repository.