Implementation of PFLD A Practical Facial Landmark Detector by Tensorflow 2.
-
Requirements: tensorflow >= 2.0.0, numpy, opencv, pytorch (optional)
-
Datasets
WFLW Dataset Download
Wider Facial Landmarks in-the-wild (WFLW) is a new proposed face dataset. It contains 10000 faces (7500 for training and 2500 for testing) with 98 fully manual annotated landmarks.
WFLW Training and Testing images Google Drive Baidu Drive
Unzip above two packages and put them on ./data/WFLW/
move Mirror98.txt to WFLW/WFLW_annotations
$ cd data
$ python3 SetPreparation.py
Generate tfrecord:
python tools/generate_tfrecord.py
-
Train
You can change configurations in
train.py
andconfig.py
. For training, just execute one line code.python train.py
-
Test
Just read
test.py
and load weight you want. -
Camera test
You should check if pytorch is installed, and load weight you want.
-
For loss function,
attributes_w_n
may all be zero, which makes loss equal to zero. So it may need to rethink about the weight. -
We provide a model called
PFLD_wing_loss_fn
which uses wing_loss and removes auxiliarynet. -
A model called
PFLD_Ultralight
is available, which uses GhostBottleneck.