/landmark_py

Landmark with Regressition in Python (LBF(3000fps), ESR and SDM)

Primary LanguagePython

Landmark with Regressition in Python

This project aim to implement all the facial landmark detection with Regressition. All the following things havd been tested on Ubuntu 14.04.

  • Supported Algorithms

LBF(Local Binary Features)[1] regression(Based on the matlab version)

  • Supported Dataset

AFW dataset.

Dependencies


All of the following modules can be easily installed by pip

PIL
numpy
scipy
scikit-learn
OpenCV (Optional: Only Used in demo_evaluate.py to show the result)

Install script on Ubuntu 14.04

sudo aptitude install python-pip gfortran
sudo pip install pillow numpy scipy sklearn
sudo aptitude install python-opencv

Demo on AFW


  1. Download the AFW dataset here
  2. Replace the location of afw by yourself in afw_test.lst and afw_train.lst in config folder(Mine is /home/samuel/data)
  3. Change afw_config.py : dataPara.path by yourself
  • Train on AFW

./demo_train.py ../config/afw_config.py

  • Evaluate on AFW

./demo_evaluate.py ../config/afw_model/train.model ../config/afw_test.lst

Tips


  1. Data Augmentation by flip the image and points

Extension


  • Training with your own dataset
    You should implement your own reader. Please refer to AFLWReader in ./cascade/dator/reader.py.

  • Implement other regression algorithm Please refer to cascade/regressor/lbfRegressor.py. And then wrapped in cascade/regressor/regressorWrapper.py

TODO


You can find more todo list via searching "TODO" in source code

  • [TODO] Set the shape increment into the tree leaf node. This can speedup the test speed
  • [TODO] Try random ferns instead of random forest
  • [TODO] Try finding the best split when training Random Forest. Now using random split
  • [TODO] Try different interpolations when computing Pixel Difference Feature
  • [TODO] Support Explicit Shape Regression
  • [TODO] Support Supervised Descent Method

References


  1. Face Alignment at 3000 FPS via Regressing Local Binary Features
  2. Face Alignment by Explicit Shape Regression
  3. Supervised Descent Method and its Applications to Face Alignment

Contact


If you have any questions, please email shenfei1208@gmail.com or creating an issue on GitHub.