This repository provides an example of painting color over the lips region based on facial landmark prediction with the Helen dataset, using transfer learning & fine tuning with a 3rd party pretrained model.
- A series of notebooks which illustrates the conversion of the raw Helen dataset to multiple TFRecord files.
- See
tfrec_gen
folder. - The
helen_ds_target_pd.ipynb
&helen_ds_img_pds.ipynb
convert the annotation & images from the Helen dataset to pandas pickle files. - The
helen_ds_img_target_pd_tfrec.ipynb
converts the pickle files to TFRecord files.
- A notebook illustrating transfer learning & fine tuning with a 3rd party
pretrained model. See
transferLearn_fineTune.ipynb
. - A Helper class that paints an overlay over the lips region of a facial
image based on ground truth as well as predictions from the learned model. See
Helper
folder.
You can get the Helen dataset here [2].
The facial features annotation follows the structure below:
- 41 points for facial outline.
- 17 points for nose outline.
- 20 points each for eyebrows outlines.
- 20 points each for eyes outlines.
- 28 points for inner mouth outline.
- 28 points for outer mouth outline.
You can get the 3rd party pretrained model here [3].
The 3rd party pretrained model is a facenet model pretrained with the MS-Celeb-1M dataset.
The code in this repository uses the following directory structure. You may want to manually create the folders before running the notebooks.
The raw Helen dataset should be placed in the helen_data
folder using the
following directory structure.
The 3rd party pretrained model should be placed in the facenet/model
directory.
├───chkpt
├───facenet
│ └───model
├───helen_data
│ ├───annotation
│ │ └───annotation
│ ├───helen_1
│ │ └───helen_1
│ ├───helen_2
│ │ └───helen_2
│ ├───helen_3
│ │ └───helen_3
│ ├───helen_4
│ │ └───helen_4
│ └───helen_5
│ └───helen_5
├───helen_pickle
├───Helper
├───saved_fig
├───saved_model
├───tfrec_data
└───tfrec_gen
The fine tuning results on unseen test set are shown below. The red overlay on
the lips region are the ground truth while the blue overlay is from the model's
prediction.
-
Interactive Facial Feature Localization Vuong Le, Jonathan Brandt, Zhe Lin, Lubomir Boudev, Thomas S. Huang ECCV2012
-
Vuong Le, Jonathan Brandt, Zhe Lin, Lubomir Boudev, Thomas S. Huang. (2012). Helen dataset. Retrieved from http://www.ifp.illinois.edu/~vuongle2/helen/
-
nyoki-mtl (2017) keras-facenet https://github.com/nyoki-mtl/keras-facenet