Awesome Open Source
Awesome Open Source

MTCNN C++ Implementation

This is a C++ project to implement MTCNN, a perfect face detect algorithm, on different DL frameworks.
The most popular frameworks: caffe/mxnet/tensorflow, are all suppported now.


  • Bulid caffe, mxnet or tensorflow first Please edit (set xxx_ON flags to enable corresponding dp framework) to select one or more to be supported

    • Build Caffe-HRT, refer to Caffe-HRT Release notes

    • Build MXNet-HRT, refer to MXNet-HRT release notes

    • Build tensorflow, to generate, please use:

      bazel build --config=opt //tensorflow/tools/lib_package:libtensorflow

      the tarball, bazel-bin/tensorflow/tools/lib_package/libtensorflow.tar.gz, includes the and c header files

  • Edit Makefile to set CAFFE_ROOT, MXNET_ROOT or TENSORFLOW_ROOT to the right path in your machine. For example : CAFFE_ROOT=/usr/local/AID/Caffe-HRT/.

  • make -j4


If the basic work is ready (build caffe/Mxnet/Tensorflow sucessfully) followed by above steps. You can run the test now.

1. Test on single picture:

./test -f photo_fname [ -t DL_type] [-s] 
  -f photo_fname  picture to be  detected
  -t DL_type      DL frame: "caffe" , "mxnet"(default) or "tensorflow"
  -s              Save face chop into jpg files

The new picture, which boxed face and 5 landmark points will be created and saved as "new.jpg"

2. Test on camera (DL Framework is caffe)


Release History

Version 0.1.0 - 2018-2-11

  • Modified readme file.
  • Modified
  • Add script


MTCNN algorithm

MTCNN C++ on Caffe

MTCNN python on Mxnet

MTCNN python on Tensorflow

FaceNet uses MTCNN to align face

From this directory:


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C Plus Plus (367,891
Tensorflow (12,583
Cnn (3,131
Face Detection (1,501
Caffe (617
Mxnet (445
Facenet (123
Related Projects