Light Weight Facial Landmark Prediction

Train a facial landmark detection model with size < 15 MB.

Install Required Packages

pip install -r requirements.txt

Get Dataset with gdown

gdown --id 1hhcsXxGehgf_wf2QJKSuwB7e3xxrTYn9
unzip data.zip

(Optional) Data Generation

Increase the training data by applying gamma correction and sobel edge detection.

python get_hybrid.py <--source_dir SOURCE> <--dest_dir DEST>
  • --source_dir : Directory to original training dataset. Inside the source directory, it must contain the annotation file, annot.pkl, and the corresponding .jpg images.
  • --dest_dir : Directory to destination. The new annot.pkl and the transformed images will be stored in it.

Usage

python main.py [--do_train TRAIN] [--do_predict PREDICT]

Example

python main.py --do_train ./config/train.json        # training
python main.py --do_predict ./config/predict.json    # inference