All Projects → iitzco → Faced

iitzco / Faced

Licence: mit
🚀 😏 Near Real Time CPU Face detection using deep learning

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Faced

Vnet.pytorch
A PyTorch implementation for V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation
Stars: ✭ 506 (-4.17%)
Mutual labels:  convolutional-neural-networks, fully-convolutional-networks
Cardiac Segmentation
Convolutional Neural Networks for Cardiac Segmentation
Stars: ✭ 94 (-82.2%)
Mutual labels:  convolutional-neural-networks, fully-convolutional-networks
Mtcnn Pytorch
Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
Stars: ✭ 531 (+0.57%)
Mutual labels:  convolutional-neural-networks, face-detection
Awslambdaface
Perform deep neural network based face detection and recognition in the cloud (via AWS lambda) with zero model configuration or tuning.
Stars: ✭ 98 (-81.44%)
Mutual labels:  convolutional-neural-networks, face-detection
Deepgaze
Computer Vision library for human-computer interaction. It implements Head Pose and Gaze Direction Estimation Using Convolutional Neural Networks, Skin Detection through Backprojection, Motion Detection and Tracking, Saliency Map.
Stars: ✭ 1,552 (+193.94%)
Mutual labels:  convolutional-neural-networks, face-detection
Cnn face detection
Implementation based on the paper Li et al., “A Convolutional Neural Network Cascade for Face Detection, ” 2015 CVPR
Stars: ✭ 251 (-52.46%)
Mutual labels:  convolutional-neural-networks, face-detection
3dunet abdomen cascade
Stars: ✭ 91 (-82.77%)
Mutual labels:  convolutional-neural-networks, fully-convolutional-networks
Tiny Faces Pytorch
Finding Tiny Faces in PyTorch
Stars: ✭ 105 (-80.11%)
Mutual labels:  convolutional-neural-networks, face-detection
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+176.52%)
Mutual labels:  convolutional-neural-networks, face-detection
Compactcnncascade
A binary library for very fast face detection using compact CNNs.
Stars: ✭ 152 (-71.21%)
Mutual labels:  convolutional-neural-networks, face-detection
Deepface
Deep Learning Models for Face Detection/Recognition/Alignments, implemented in Tensorflow
Stars: ✭ 409 (-22.54%)
Mutual labels:  convolutional-neural-networks, face-detection
Facecropper
✂️ Crop faces, inside of your image, with iOS 11 Vision api.
Stars: ✭ 479 (-9.28%)
Mutual labels:  face-detection
Cnn lstm ctc ocr
Tensorflow-based CNN+LSTM trained with CTC-loss for OCR
Stars: ✭ 464 (-12.12%)
Mutual labels:  convolutional-neural-networks
Robustness
Corruption and Perturbation Robustness (ICLR 2019)
Stars: ✭ 463 (-12.31%)
Mutual labels:  convolutional-neural-networks
Pba
Efficient Learning of Augmentation Policy Schedules
Stars: ✭ 461 (-12.69%)
Mutual labels:  convolutional-neural-networks
Stn Ocr
Code for the paper STN-OCR: A single Neural Network for Text Detection and Text Recognition
Stars: ✭ 473 (-10.42%)
Mutual labels:  convolutional-neural-networks
Brfv4 javascript examples
BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
Stars: ✭ 460 (-12.88%)
Mutual labels:  face-detection
Food Recipe Cnn
food image to recipe with deep convolutional neural networks.
Stars: ✭ 448 (-15.15%)
Mutual labels:  convolutional-neural-networks
Colorization Pytorch
PyTorch reimplementation of Interactive Deep Colorization
Stars: ✭ 449 (-14.96%)
Mutual labels:  convolutional-neural-networks
Convnet Drawer
Python script for illustrating Convolutional Neural Networks (CNN) using Keras-like model definitions
Stars: ✭ 516 (-2.27%)
Mutual labels:  convolutional-neural-networks

faced

🚀 😏 CPU (Near) Real Time face detection

How to install

$ pip install git+https://github.com/iitzco/faced.git

Soon to be available on PyPI.

How to use

As library

import cv2

from faced import FaceDetector
from faced.utils import annotate_image

face_detector = FaceDetector()

img = cv2.imread(img_path)
rgb_img = cv2.cvtColor(img.copy(), cv2.COLOR_BGR2RGB)

# Receives RGB numpy image (HxWxC) and
# returns (x_center, y_center, width, height, prob) tuples. 
bboxes = face_detector.predict(rgb_img, thresh)

# Use this utils function to annotate the image.
ann_img = annotate_image(img, bboxes)

# Show the image
cv2.imshow('image',ann_img)
cv2.waitKey(0)
cv2.destroyAllWindows()

As command-line program

# Detection on image saving the output
$ faced --input imgs/demo.png --save

or

# Live webcam detection
$ faced --input webcam

or

# Detection on video with low decision threshold
$ faced --input imgs/demo.mp4 --threshold 0.5

See faced --help for more information.

Examples

Performance

CPU (i5 2015 MBP) GPU (Nvidia TitanXP)
~5 FPS > 70 FPS

Comparison with Haar Cascades

Haar Cascades are one of the most used face detections models. Here's a comparison with OpenCV's implementation showing faced robustness.

faced Haar Cascade

About faced

faced is an ensemble of 2 deep neural networks (implemented using tensorflow) designed to run at Real Time speed in CPUs.

Stage 1:

A custom fully convolutional neural network (FCNN) implementation based on YOLO. Takes a 288x288 RGB image and outputs a 9x9 grid where each cell can predict bounding boxes and probability of one face.

Stage 2:

A custom standard CNN (Convolutions + Fully Connected layers) is used to take a face-containing rectangle and predict the face bounding box. This is a fine-tunning step. (outputs of Stage 1 model is not so accurate by itself, this is a corrector step that takes the each bouding box predicted from the previous step to improve bounding box quality.)

Why not just perform transfer learning on trained YOLO (or MobileNet+SSD) ?

Those models were designed to support multiclass detection (~80 classes). Because of this, these networks have to be powerfull enough to capture many different low and high level features that allow them to understand the patterns of very different classes. Powerful in this context means large amount of learnable parameters and hence big networks. These big networks cannot achieve real time performance on CPUs. [1]

This is an overkill for the simple task of just detecting faces. This work is a proof of concept that lighter networks can be designed to perform simpler tasks that do not require relatively large number of features.

[1] Those models cannot perform Real Time on CPU (YOLO at least). Even tiny-yolo version cannot achieve 1 fps on CPU (tested on 2015 MacBook Pro with 2.6 GHz Intel Core i5).

How was it trained?

Training was done with WIDER FACE dataset on Nvidia Titan XP GPU.

If you are interested in the training process and/or data preprocessing, just raise an issue and we'll discuss it there.

How to run on GPU?

Just install tensorflow-gpu instead of tensorflow.

Status

🚧 Work in progress 🚧 Models will be improved and uploaded.

This is not a Production ready system. Use it at your own risk.

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