All Projects → ksachdeva → Opencv Mtcnn

ksachdeva / Opencv Mtcnn

Licence: apache-2.0
An implementation of MTCNN Face detector using OpenCV's DNN module

Projects that are alternatives of or similar to Opencv Mtcnn

Awesome Face Detection
Compare with various detectors - s3fd, dlib, ocv, ocv-dnn, mtcnn-pytorch, face_recognition
Stars: ✭ 106 (+79.66%)
Mutual labels:  opencv, face-detection, mtcnn
Tf2
An Open Source Deep Learning Inference Engine Based on FPGA
Stars: ✭ 113 (+91.53%)
Mutual labels:  opencl, inference, dnn
Facepixeler
A simple C# program that can automatically detect and blur faces in images. Uses OpenCV and EmguCV.
Stars: ✭ 5 (-91.53%)
Mutual labels:  opencv, face-detection
Mocr
Meaningful Optical Character Recognition from identity cards with Deep Learning.
Stars: ✭ 19 (-67.8%)
Mutual labels:  opencv, face-detection
Flask face detection
Face detection example in Python 3 based on OpenCV and Flask
Stars: ✭ 55 (-6.78%)
Mutual labels:  opencv, face-detection
Ultra Light Fast Generic Face Detector 1mb
💎1MB lightweight face detection model (1MB轻量级人脸检测模型)
Stars: ✭ 6,182 (+10377.97%)
Mutual labels:  face-detection, inference
Human Detection And Tracking
Human-detection-and-Tracking
Stars: ✭ 753 (+1176.27%)
Mutual labels:  opencv, face-detection
Fast face detector
A face detector based on the work "Aggregate channel features for multi-view face detection" presented by Bin Yang, Junjie Yan, Zhen Lei and Stan Z. Li.
Stars: ✭ 35 (-40.68%)
Mutual labels:  opencv, face-detection
Gocv
Go package for computer vision using OpenCV 4 and beyond.
Stars: ✭ 4,511 (+7545.76%)
Mutual labels:  opencv, dnn
Realtimefaceapi
This is a demo project showing how to use Face API in Cognitive Services with OpenCV
Stars: ✭ 44 (-25.42%)
Mutual labels:  opencv, face-detection
Predict Facial Attractiveness
Using OpenCV and Dlib to predict facial attractiveness.
Stars: ✭ 41 (-30.51%)
Mutual labels:  opencv, face-detection
Android Hpe
Android native application to perform head pose estimation using images coming from the front camera.
Stars: ✭ 46 (-22.03%)
Mutual labels:  opencv, face-detection
Php Opencv
PHP extensions for OpenCV
Stars: ✭ 524 (+788.14%)
Mutual labels:  opencv, face-detection
Opencv4nodejs
Nodejs bindings to OpenCV 3 and OpenCV 4
Stars: ✭ 4,444 (+7432.2%)
Mutual labels:  opencv, face-detection
Opencv Face Filters
Snapchat-like Face Filters in OpenCV
Stars: ✭ 51 (-13.56%)
Mutual labels:  opencv, face-detection
Tensorflow Cmake
TensorFlow examples in C, C++, Go and Python without bazel but with cmake and FindTensorFlow.cmake
Stars: ✭ 418 (+608.47%)
Mutual labels:  opencv, inference
Brfv4 mac examples
macOS C++ examples utilizing OpenCV for camera access and drawing the face tracking results.
Stars: ✭ 25 (-57.63%)
Mutual labels:  opencv, face-detection
Idmatch
Match faces on id cards with OCR capabilities.
Stars: ✭ 52 (-11.86%)
Mutual labels:  opencv, face-detection
Mtcnn
全平台实时人脸检测和姿态估计,提供无需任何框架实现Realtime Face Detection and Head pose estimation on Windows、Ubuntu、Mac、Android and iOS
Stars: ✭ 351 (+494.92%)
Mutual labels:  face-detection, mtcnn
Libfaceid
libfaceid is a research framework for prototyping of face recognition solutions. It seamlessly integrates multiple detection, recognition and liveness models w/ speech synthesis and speech recognition.
Stars: ✭ 354 (+500%)
Mutual labels:  opencv, face-detection

opencv-mtcnn

This is an inference implementation of MTCNN (Multi-task Cascaded Convolutional Network) to perform Face Detection and Alignment using OpenCV's DNN module.

MTCNN

[ZHANG2016] Zhang, K., Zhang, Z., Li, Z., and Qiao, Y. (2016). Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499–1503.

https://kpzhang93.github.io/MTCNN_face_detection_alignment/paper/spl.pdf

OpenCV's DNN module

Since OpenCV 3.1 there is a module called DNN that provides the inference support. The module is capable of taking models & weights from various popular frameworks such as Caffe, tensorflow, darknet etc.

You can read more about it here - https://github.com/opencv/opencv/wiki/Deep-Learning-in-OpenCV

Note that at present there is no support to perform training in OpenCV's DNN module and if I understood correctly there is no intention either.

Compile / Run

Requirements

  • OpenCV 3.4+
  • Boost FileSystem (1.58+) [only required for the sample application]
  • CMake 3.2+

I am using CMake as the build tool. Here are the steps to try the implementation -

# compiling the library and the sample application
git clone https://github.com/ksachdeva/opencv-mtcnn
cd opencv-mtcnn
mkdir build
cd build
cmake ..
cmake --build .
# running the sample application
cd build
./sample/app <path_to_models_dir> <path_to_test_image>

# here are some example cmd lines to run with the model and images in the test repository

# An image with 0 human faces (have picture of 4 dogs)
./sample/app ../data/models ../data/dogs.jpg

# An image with 1 face
./sample/app ../data/models ../data/Aaron_Peirsol_0003.jpg

# An image with 7 faces
./sample/app ../data/models ../data/2007_007763.jpg

Result

Here is an example of how the execution of the sample application looks like

Result

Acknowledgments

Most of the implementations of MTCNN are based on either Caffe or Tensorflow. I wanted to play with OpenCV's DNN implementation and understand the paper bit better. While implementing it, I looked at various other C++ implementations (again all of them use Caffe) and more specifically borrowed utilities from https://github.com/golunovas/mtcnn-cpp. IMHO, I found his implementation (in C++) that is based on Caffe to be the cleanest amongst many others.

The model files are taken from https://github.com/kpzhang93/MTCNN_face_detection_alignment/tree/master/code

The image file "Aaron_Peirsol_0003.jpg" is from the LFW database (http://vis-www.cs.umass.edu/lfw/)

The image files "dog.jpg" & "2007_007763.jpg" are from dlib's github repository (https://github.com/davisking/dlib/blob/master/examples/faces)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].