Need help with FaceDetection?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

140 Stars 67 Forks MIT License 5 Commits 4 Opened issues


:star2: Human Face Detection based on AdaBoost

Services available


Need anything else?

Contributors list

# 47,740
5 commits

EFace -- A project of face detection in Python

This project name as

which is a implementation of face detection algorithm.

My nick name is

. For convenient, I name it as

It's stimulating to do this project. Enjoy with it.

The architecture of this project.

The following list show the files in this awesome project.

  • Implementation of Adaptive Boosting algorithm

  • Cascade Decision Tree

  • All parameters of configuration in this project are stored in this file.

  • The initialization of images. class Image and class ImageSet are in this file.

  • Stuff with Haar-Features.

  • The detail about Weak classifier.

  • Script for training the model.


  • model/ cache files for adaboost model.

  • featuers/ values for different feaures with different samples.

  • doc/ documents with this project.


For training a adaboost model:

     python ./

To detect faces in a image, you have to define the TEST_IMG which is the path where store your image:

    python ./

Presentation of current result:

I'm still working on making this project more powerful. So, here is the presentation of current result.




Programming Style:

I used basic OOP(Object Oriented Programming) tricks to build my program. Something like... I put all about

into a class(AdaBoost) which you can find in file
. Everytime you want to do something with adaboost, just create a object instance of that class.

Adavantages of this style: Higher level of abstraction and easy to be used. With this style, green hand will easy to build good archtecture with our project.

Disadvantages of this style: Without optimalization, it will cost a lot of memory. This will be obvious when the scale of project goes more and more large.

During this period when I working on the project, I meet a lots of problem. But I also want to say "thanks" to these problem. It help me a lot to enhance my ability in programming.

  • Exception Handle The training process cost too much time. Sometimes, we have a better idea to change the code into a better version. But the trainning process is going on. If we press

    ctrl + c
    to interrupt, the data that we have get from the
    process will lost.

    I use a handler for

    and then save the data of model so that the valuable data won't be lose.
  • High Performance Programming in Python

    There have lots of tricks to make native Python code run more faster. The computation of image processing is very huge. This means that it's a typical problem about CPU-bound.

  • Concurrent Control To improve the performance of this system in the training process, I try to use parallel mechanism with the two CPU in my workstation.

... ...

Optimization diary

2016-04-09 Restart to built this project and finished optimize the

2016-04-13 refactor the and make it more light. create a new module In, @idxVector is initialized by numpy.zeros, it's faster than numpy.array([0 for i in range(length)])

2016-04-15 going to optimal and Try to vectorize

2016-04-16 change and use different size of final classifier image but not resize the inputed image.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.