/jointCascade_py

Joint Cascade Face Detection and Alignment

Primary LanguagePython

Joint Cascade Face Detection and Alignment in Python

Implementing the joint cascade face detector on AFW dataset. And this implementation is based on landmark_py. All the things have benn tested on Ubuntu 14.04.

Dependencies


All of the following modules can be easily installed by pip

PIL
numpy
scipy
scikit-learn
OpenCV

Install script on Ubuntu 14.04

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

Demo on AFW


I have trained a model based on AFW(only contain 337 faces) with 5 non-face images for demo. You should train the model on a big dataset

  1. Download the AFW dataset here
  2. Replace the location of afw by yourself in afw.txt and neg.txt in config folder(Mine is /home/samuel/data)
  3. Change afw_config.py:dataPara:posList, negList by yourself
  • Train on AFW

python -W ignore ./demo_train.py ../config/afw_config.py

  • Detection with the Pretrained AFW Model

python -W ignore ./demo_detect.py ../config/afw_model/train.model ../config/pos.jpg

TODO


  1. Use the non-maximum suppression to find the best face rects instead to merge the rects via cv2.grouprects

References


  1. Face Alignment at 3000 FPS via Regressing Local Binary Features
  2. Joint Cascade Face Detection and Alignment

Contact


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