Skip to content

A simple method for face alignment based on wingloss and mutitask learning :)

License

Notifications You must be signed in to change notification settings

jingziyou/face_landmark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

face_landmark

A simple face aligment method

introduction

A simple face aligment method based on tensorflow. It is simple and flexible, trained with wingloss , multi task learning, also with data augmentation based on headpose and face attributes(eyes state and mouth state).

CN blog

And i suggest that you could try with another project,including face detect and keypoints, and some optimizations were made, u can check it there [pappa_pig_face_engine].

Contact me if u have problem about it. [email protected] :)

demo pictures:

samples

gifs

this gif is from github.com/610265158/Peppa_Pig_Face_Engine, but it is the same model : )

pretrained model:

requirment

  • tensorflow1.14 (tensorflow 1.14 at least if mix_precision turns on)

  • tensorpack (for data provider)

  • opencv

  • python 3.6

useage

train

  1. download all the 300W data set including the 300VW(parse as images, and make the label the same formate as 300W)
├── 300VW
│   ├── 001_annot
│   ├── 002_annot
│       ....
├── 300W
│   ├── 01_Indoor
│   └── 02_Outdoor
├── AFW
│   └── afw
├── HELEN
│   ├── testset
│   └── trainset
├── IBUG
│   └── ibug
├── LFPW
│   ├── testset
│   └── trainset
  1. run python make_list.py produce train.txt and val.txt (if u like train u own data, u should prepare the data like this: ****.jpg| x1 y1 x2 y2 x3 y3...

  2. then, run: python train.py

  3. by default it trained with shufflenetv2_1.0, if u like want train with resnet,do as follow:

    4.1 download pretrained model resnet50

    4.2 change train_config as config.MODEL.net_structure='resnet_v1_50',config.MODEL.pretrained_model='resnet_v1_50.ckpt', it uses the first three blocks, so it is still fast, a pruning may achieve a better one.

convert model

After training, convert the model to pb file and visualization.

run python tools/auto_freeze.py produce keypoint.pb

visualization

python vis.py

TODO:

About

A simple method for face alignment based on wingloss and mutitask learning :)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%