All Projects → blaueck → tf-mtcnn

blaueck / tf-mtcnn

Licence: MIT license
This project provide a single tensorflow model implement the mtcnn face detector. And it shows how to convert model from caffe to tensorflow in a hard way.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tf-mtcnn

Goface
Face Detector based on MTCNN, tensorflow and golang
Stars: ✭ 109 (-6.84%)
Mutual labels:  mtcnn
Raspberrypi Facedetection Mtcnn Caffe With Motion
MTCNN with Motion Detection, on Raspberry Pi with Love
Stars: ✭ 204 (+74.36%)
Mutual labels:  mtcnn
Face Alignment
🔥 2D and 3D Face alignment library build using pytorch
Stars: ✭ 5,417 (+4529.91%)
Mutual labels:  face-detector
Keras Mtcnn
mtcnn face detection transplanted to keras
Stars: ✭ 110 (-5.98%)
Mutual labels:  mtcnn
Facenet Pytorch
Pretrained Pytorch face detection (MTCNN) and facial recognition (InceptionResnet) models
Stars: ✭ 2,564 (+2091.45%)
Mutual labels:  mtcnn
GenderRecognizer
Plain Face Detector & Gender Recognizer
Stars: ✭ 57 (-51.28%)
Mutual labels:  face-detector
Awesome Face Detection
Compare with various detectors - s3fd, dlib, ocv, ocv-dnn, mtcnn-pytorch, face_recognition
Stars: ✭ 106 (-9.4%)
Mutual labels:  mtcnn
etos-facedetector
Simple and Effective Face Detector, based on Progressive Calibration Networks (PCN) which is an accurate rotation-invariant face detector running at real-time speed on CPU, published in CVPR 2018.
Stars: ✭ 23 (-80.34%)
Mutual labels:  face-detector
Facerecognition
Webcam face recognition using tensorflow and opencv
Stars: ✭ 192 (+64.1%)
Mutual labels:  mtcnn
retinaface
RetinaFace: Deep Face Detection Library for Python
Stars: ✭ 242 (+106.84%)
Mutual labels:  face-detector
Insightface ncnn
Stars: ✭ 121 (+3.42%)
Mutual labels:  mtcnn
Facenet
Face recognition using Tensorflow
Stars: ✭ 12,189 (+10317.95%)
Mutual labels:  mtcnn
sfd.gluoncv
Reproduce SFD face detector using gluon-cv
Stars: ✭ 23 (-80.34%)
Mutual labels:  face-detector
Mtcnn
MTCNN face detection implementation for TensorFlow, as a PIP package.
Stars: ✭ 1,689 (+1343.59%)
Mutual labels:  mtcnn
Lbpcascade animeface
A Face detector for anime/manga using OpenCV
Stars: ✭ 1,679 (+1335.04%)
Mutual labels:  face-detector
Tensorflow Mtcnn
C++ and python Inference only for MTCNN face detector on Tensorflow. Based on davidsandberg's facenet project:
Stars: ✭ 106 (-9.4%)
Mutual labels:  mtcnn
Mtcnn caffe
Simple implementation of kpzhang93's paper from Matlab to c++, and don't change models.
Stars: ✭ 244 (+108.55%)
Mutual labels:  mtcnn
FaceIDLight
A lightweight face-recognition toolbox and pipeline based on tensorflow-lite
Stars: ✭ 17 (-85.47%)
Mutual labels:  mtcnn
pymtcnn
mtcnn python implementation based on Caffe framework
Stars: ✭ 30 (-74.36%)
Mutual labels:  mtcnn
jeelizGlanceTracker
JavaScript/WebGL lib: detect if the user is looking at the screen or not from the webcam video feed. Lightweight and robust to all lighting conditions. Great for play/pause videos if the user is looking or not, or for person detection. Link to live demo.
Stars: ✭ 68 (-41.88%)
Mutual labels:  face-detector

Description

This project provide a single tensorflow model implemented the mtcnn face detector. It is very handy for face detection in python and easy for deployment with tensorflow. The model is converted and modified from the original author's caffe model.

For more detail about mtcnn, see the original project.

Requirement

  • tensorflow >= 1.5.0 (older version may work as well, but it is not tested)
  • opencv python binding (for reading image and show the result)
  • pycaffe (optional, for convert model from caffe to tensorflow)

Run

# simple detection demo
python mtcnn.py test_image.jpg

# for tensorflow 2.0
python mtcnn_tfv2.py test_image.jpg

# A demo shows how to use tensorflow dataset api
# to accelerate detection with multi-cores. This is
# especially useful for processing large amount of
# small image data in a powerful server.
python mtcnn_data.py imglist.txt result

Convert model

The default model mtcnn.pb will work well. But if you want to modify the model's behave, you may need to convert the model yourself.

# download model from original project
git clone https://github.com/kpzhang93/MTCNN_face_detection_alignment
# convert model
python caffe2tf.py MTCNN_face_detection_alignment/code/codes/MTCNNv1/model ./mtcnn.pb

Result

result.jpg

Input and Ouput

Input:

BGR image.

Output:

  • box: bouding box, 2D float tensor with format [[y1, x1, y2, x2], ...]
  • prob: confidence, 1D float tensor with format [x, ...]
  • landmarks: face landmarks, 2D float tensor with format[[y1, y2, y3, y4, y5, x1, x2, x3, x4, x5], ...]

Note

  • The mtcnn.pb is not compatible with tensorflow with version 1.12. You can use mtcnn_1.12.pb or consider to convert the model your self.
  • Because the model is designed to work with opencv, so the input image format is BGR instead of RGB. If you prefer RGB, you can modify the convert script and convert the model yourself.
  • The convert code make the model more suitable for tensorflow and opencv by modifying the model's parameters.
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].