All Projects → faciallab → Facedetector

faciallab / Facedetector

A re-implementation of mtcnn. Joint training, tutorial and deployment together.

Projects that are alternatives of or similar to Facedetector

Raspberrypi Facedetection Mtcnn Caffe With Motion
MTCNN with Motion Detection, on Raspberry Pi with Love
Stars: ✭ 204 (+106.06%)
Mutual labels:  jupyter-notebook, cnn, mtcnn
One Pixel Attack Keras
Keras implementation of "One pixel attack for fooling deep neural networks" using differential evolution on Cifar10 and ImageNet
Stars: ✭ 1,097 (+1008.08%)
Mutual labels:  jupyter-notebook, cnn
Convisualize nb
Visualisations for Convolutional Neural Networks in Pytorch
Stars: ✭ 57 (-42.42%)
Mutual labels:  jupyter-notebook, cnn
Gtsrb
Convolutional Neural Network for German Traffic Sign Recognition Benchmark
Stars: ✭ 65 (-34.34%)
Mutual labels:  jupyter-notebook, cnn
Face Identification With Cnn Triplet Loss
Face identification with cnn+triplet-loss written by Keras.
Stars: ✭ 45 (-54.55%)
Mutual labels:  jupyter-notebook, cnn
Lung Diseases Classifier
Diseases Detection from NIH Chest X-ray data
Stars: ✭ 52 (-47.47%)
Mutual labels:  jupyter-notebook, cnn
Deeplearning Nlp Models
A small, interpretable codebase containing the re-implementation of a few "deep" NLP models in PyTorch. Colab notebooks to run with GPUs. Models: word2vec, CNNs, transformer, gpt.
Stars: ✭ 64 (-35.35%)
Mutual labels:  jupyter-notebook, cnn
Neural Networks
All about Neural Networks!
Stars: ✭ 34 (-65.66%)
Mutual labels:  jupyter-notebook, cnn
Understaing Datasets Estimators Tfrecords
Try to use tf.estimator and tf.data together to train a cnn model.
Stars: ✭ 76 (-23.23%)
Mutual labels:  jupyter-notebook, cnn
Pytorch
PyTorch tutorials A to Z
Stars: ✭ 87 (-12.12%)
Mutual labels:  jupyter-notebook, cnn
End To End Sequence Labeling Via Bi Directional Lstm Cnns Crf Tutorial
Tutorial for End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF
Stars: ✭ 87 (-12.12%)
Mutual labels:  jupyter-notebook, cnn
Svhn Cnn
Google Street View House Number(SVHN) Dataset, and classifying them through CNN
Stars: ✭ 44 (-55.56%)
Mutual labels:  jupyter-notebook, cnn
Yann
This toolbox is support material for the book on CNN (http://www.convolution.network).
Stars: ✭ 41 (-58.59%)
Mutual labels:  jupyter-notebook, cnn
Text nn
Text classification models. Used a submodule for other projects.
Stars: ✭ 55 (-44.44%)
Mutual labels:  jupyter-notebook, cnn
Keras basic
keras를 이용한 딥러닝 기초 학습
Stars: ✭ 39 (-60.61%)
Mutual labels:  jupyter-notebook, cnn
Embedded gcnn
Embedded Graph Convolutional Neural Networks (EGCNN) in TensorFlow
Stars: ✭ 60 (-39.39%)
Mutual labels:  jupyter-notebook, cnn
Pytorch Pos Tagging
A tutorial on how to implement models for part-of-speech tagging using PyTorch and TorchText.
Stars: ✭ 96 (-3.03%)
Mutual labels:  jupyter-notebook, cnn
Gaze Estimation
A deep learning based gaze estimation framework implemented with PyTorch
Stars: ✭ 33 (-66.67%)
Mutual labels:  jupyter-notebook, cnn
Dl Colab Notebooks
Try out deep learning models online on Google Colab
Stars: ✭ 969 (+878.79%)
Mutual labels:  jupyter-notebook, cnn
Cnn Interpretability
🏥 Visualizing Convolutional Networks for MRI-based Diagnosis of Alzheimer’s Disease
Stars: ✭ 68 (-31.31%)
Mutual labels:  jupyter-notebook, cnn

MTCNN

pytorch implementation of inference and training stage of face detection algorithm described in
Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks.

Why this projects

mtcnn-pytorch This is the most popular pytorch implementation of mtcnn. There are some disadvantages we found when using it for real-time detection task.

  • No training code.
  • Mix torch operation and numpy operation together, which resulting in slow inference speed.
  • No unified interface for setting computation device. ('cpu' or 'gpu')
  • Based on the old version of pytorch (0.2).

So we create this project and add these features:

  • Add code for training stage, you can train model by your own datasets.
  • Transfer all numpy operation to torch operation, so that it can benefit from gpu acceleration. It's 10 times faster than the original repo mtcnn-pytorch.
  • Provide unified interface to assign 'cpu' or 'gpu'.
  • Based on the latest version of pytorch (1.0) and we will provide long-term support.
  • It's is a component of our FaceLab ecosystem.
  • Real-time face tracking.
  • Friendly tutorial for beginner.

Installation

Create virtual env use conda (recommend)

conda create -n face_detection python=3
source activate face_detection

Installation dependency package

pip install opencv-python numpy easydict Cython progressbar2 torch tensorboardX

If you have gpu on your mechine, you can follow the official instruction and install pytorch gpu version.

Compile the cython code

Compile with gpu support

python setup.py build_ext --inplace

Compile with cpu only

python setup.py build_ext --inplace --disable_gpu 

Also, you can install mtcnn as a package

python setup.py install

Test the code by example

We assume all these command running in the $SOURCE_ROOT directory.

Detect on example picture

python -m unittest tests.test_detection.TestDetection.test_detection

Detect on video

python scripts/detect_on_video.py --video_path ./tests/asset/video/school.avi --device cuda:0 --minsize 24

you can set device to 'cpu' if you have no valid gpu on your machine

Basic Usage

import cv2
import mtcnn

# First we create pnet, rnet, onet, and load weights from caffe model.
pnet, rnet, onet = mtcnn.get_net_caffe('output/converted')

# Then we create a detector
detector = mtcnn.FaceDetector(pnet, rnet, onet, device='cuda:0')

# Then we can detect faces from image
img = 'tests/asset/images/office5.jpg'
boxes, landmarks = detector.detect(img)

# Then we draw bounding boxes and landmarks on image
image = cv2.imread(img)
image = mtcnn.utils.draw.draw_boxes2(image, boxes)
image = mtcnn.utils.draw.batch_draw_landmarks(image, landmarks)

# Show the result
cv2.imshwow("Detected image.", image)
cv2.waitKey(0)

Doc

Train your own model from scratch

Tutorial

Detect step by step.

face_alignment step by step

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].