A simple method for face alignment based on wingloss and mutitask learning :)
A simple face aligment method, based on tensorflow2.0
This is the tensorflow2.0 branch, if u need to work on tf1 switch to branch tf1, it still work.
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).
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 [pappapigface_engine].
Contact me if u have problem about it. [email protected] :)
this gif is from github.com/610265158/PeppaPigFace_Engine, but it is the same model : )
tensorpack (for data provider)
├── 300VW │ ├── 001_annot │ ├── 002_annot │ .... ├── 300W │ ├── 01_Indoor │ └── 02_Outdoor ├── AFW │ └── afw ├── HELEN │ ├── testset │ └── trainset ├── IBUG │ └── ibug ├── LFPW │ ├── testset │ └── trainset
python make_json.pyproduce train.json and val.json (if u like train u own data, please read the json produced , it is quite simple)
by default it trained with shufflenetv2_1.0
./model/ └── keypoints ├── saved_model.pb └── variables ├── variables.data-00000-of-00002 ├── variables.data-00001-of-00002 └── variables.index
set config.MODEL.pretrainedmodel='./model/keypoints/variables/variables', in trainconfig.py
adjust the lr policy
modify the model path in toos/converttotflite.py
python toos/convert_to_tflite.pyit will produce converted_model.tflite
CAUTION: the pretrained model shufflenentv2_1.0 is not ok with tflite, because the shuffle op, but it was fixed, if u need 1.0 please retrain, or wait for me.
python vis.py --model ./model/keypoints or python vis.py --model ./model/keypoints.tflite (need conver to tflite first)