All Projects → shaoanlu → Face_toolbox_keras

shaoanlu / Face_toolbox_keras

A collection of deep learning frameworks ported to Keras for face analysis.

Projects that are alternatives of or similar to Face toolbox keras

Autocrop
😌 Automatically detects and crops faces from batches of pictures.
Stars: ✭ 320 (+58.42%)
Mutual labels:  jupyter-notebook, face-detection
Pythoncode Tutorials
The Python Code Tutorials
Stars: ✭ 544 (+169.31%)
Mutual labels:  jupyter-notebook, face-detection
Ownphotos
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (+1180.69%)
Mutual labels:  jupyter-notebook, face-detection
Getting Things Done With Pytorch
Jupyter Notebook tutorials on solving real-world problems with Machine Learning & Deep Learning using PyTorch. Topics: Face detection with Detectron 2, Time Series anomaly detection with LSTM Autoencoders, Object Detection with YOLO v5, Build your first Neural Network, Time Series forecasting for Coronavirus daily cases, Sentiment Analysis with BERT.
Stars: ✭ 738 (+265.35%)
Mutual labels:  jupyter-notebook, face-detection
Face Classification
Face model to classify gender and race. Trained on LFWA+ Dataset.
Stars: ✭ 104 (-48.51%)
Mutual labels:  jupyter-notebook, face-detection
Insightface Just Works
Insightface face detection and recognition model that just works out of the box.
Stars: ✭ 127 (-37.13%)
Mutual labels:  jupyter-notebook, face-detection
Mtcnn Pytorch
Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
Stars: ✭ 531 (+162.87%)
Mutual labels:  jupyter-notebook, face-detection
Realtimefacedetection
基于YOLO-lite的web实时人脸检测,tfjs人脸检测,目标检测
Stars: ✭ 38 (-81.19%)
Mutual labels:  jupyter-notebook, face-detection
Tensorflow Lite Rest Server
Expose tensorflow-lite models via a rest API
Stars: ✭ 43 (-78.71%)
Mutual labels:  jupyter-notebook, face-detection
Sphereface
Implementation for <SphereFace: Deep Hypersphere Embedding for Face Recognition> in CVPR'17.
Stars: ✭ 1,483 (+634.16%)
Mutual labels:  jupyter-notebook, face-detection
Deep Face Recognition
One-shot Learning and deep face recognition notebooks and workshop materials
Stars: ✭ 147 (-27.23%)
Mutual labels:  jupyter-notebook, face-detection
Urban Informatics And Visualization
Urban Informatics and Visualization (UC Berkeley CP255)
Stars: ✭ 200 (-0.99%)
Mutual labels:  jupyter-notebook
Rosetta
Tools, wrappers, etc... for data science with a concentration on text processing
Stars: ✭ 200 (-0.99%)
Mutual labels:  jupyter-notebook
Allensdk
code for reading and processing Allen Institute for Brain Science data
Stars: ✭ 200 (-0.99%)
Mutual labels:  jupyter-notebook
Spark Practice
Apache Spark (PySpark) Practice on Real Data
Stars: ✭ 200 (-0.99%)
Mutual labels:  jupyter-notebook
Joyful Pandas
pandas中文教程
Stars: ✭ 2,788 (+1280.2%)
Mutual labels:  jupyter-notebook
Lsstc Dsfp Sessions
Lecture slides, Jupyter notebooks, and other material from the LSSTC Data Science Fellowship Program
Stars: ✭ 201 (-0.5%)
Mutual labels:  jupyter-notebook
Sdc Lane And Vehicle Detection Tracking
OpenCV in Python for lane line and vehicle detection/tracking in autonomous cars
Stars: ✭ 200 (-0.99%)
Mutual labels:  jupyter-notebook
Ropsten
Ropsten public testnet PoW chain
Stars: ✭ 199 (-1.49%)
Mutual labels:  jupyter-notebook
Image To 3d Bbox
Build a CNN network to predict 3D bounding box of car from 2D image.
Stars: ✭ 200 (-0.99%)
Mutual labels:  jupyter-notebook

face-toolbox-keras

A collection of deep learning frameworks ported to Keras for face detection, face segmentation, face parsing, iris detection, and face verification.

Descriptions

This repository contains deep learning frameworks that we collected and ported to Keras. We wrapped those models into separate modules that aim to provide their functionality to users within 3 lines of code.

*Each module follows the license of their source repo. Notice that some models were trained on dataset with non-commercial license.

Usage

Open In Colab (Please run pip install keras==2.2.4 before initializaing models.)

This colab demo requires a GPU instance. It demonstrates all face analysis functionalities above.

1. Face detection

models.detector.face_detector.FaceAlignmentDetector(fd_weights_path=..., lmd_weights_path=..., fd_type="s3fd")

Arguments

  • fd_weights_path: A string. Path to weights file of the face detector model.
  • lmd_weights_path: A string. Path to weights file of the landmarks detector model.
  • fd_type: A string. Face detector backbone model of either s3fd or mtcnn.

Example

from models.detector import face_detector

im = cv2.imread(PATH_TO_IMAGE)[..., ::-1]
fd = face_detector.FaceAlignmentDetector()
bboxes = fd.detect_face(im, with_landmarks=False)

2. Face landmarks detection

The default model is 2DFAN-4. Lite models of 2DFAN-1 and 2DFAN-2 are also provided.

GPU 2DFAN-1 2DFAN-2 2DFAN-4
K80 74.3ms 92.2ms 133ms

Example

from models.detector import face_detector

im = cv2.imread(PATH_TO_IMAGE)[..., ::-1]
fd = face_detector.FaceAlignmentDetector()
bboxes, landmarks = fd.detect_face(im, with_landmarks=True)

3. Face parsing

models.parser.face_parser.FaceParser(path_bisenet_weights=...)

Arguments

  • path_bisenet_weights: A string. Path to weights file of the model.

Example

from models.parser import face_parser

im = cv2.imread(PATH_TO_IMAGE)[..., ::-1]
fp = face_parser.FaceParser()
# fp.set_detector(fd) # fd = face_detector.FaceAlignmentDetector()
parsing_map = fp.parse_face(im, bounding_box=None, with_detection=False)

4. Eye region landmarks detection

models.detector.iris_detector.IrisDetector()

Faster face detection using MTCNN can be found in this repo.

Example

from models.detector import iris_detector

im = cv2.imread(PATH_TO_IMAGE)[..., ::-1]
idet = iris_detector.IrisDetector()
idet.set_detector(fd) # fd = face_detector.FaceAlignmentDetector()
eye_landmarks = idet.detect_iris(im)

5. Face verification

models.verifier.face_verifier.FaceVerifier(extractor="facenet", classes=512)

Argument

  • extractor: A string, one of facenet, insightface, ir50_ms1m, or ir50_asia.
  • classes: An integer. Dimension of output embeddings.

Example

from models.verifier import face_verifier

im1 = cv2.imread(PATH_TO_IMAGE1)[..., ::-1]
im2 = cv2.imread(PATH_TO_IMAGE2)[..., ::-1]
fv = face_verifier.FaceVerifier(extractor="facenet")
# fv.set_detector(fd) # fd = face_detector.FaceAlignmentDetector()
result, distance = fv.verify(im1, im2, threshold=0.5, with_detection=False, with_alignment=False, return_distance=True)

6. Gender and age estimation

models.estimator.gender_age_estimator.GenderAgeEstimator(model_type="insightface")

Arguments

  • model_type: A string, only insightface is supported now.

Example

from models.estimator import gender_age_estimator

im = cv2.imread(PATH_TO_IMAGE)[..., ::-1]
gae = gender_age_estimator.GenderAgeEstimator()
gae.set_detector(fd) # fd = face_detector.FaceAlignmentDetector()
gender, age = gae.predict_gender_age(im, with_detection=True)

Ported model weights

Known issues

It works fine on Colab at this point (2019/06/11) but for certain Keras/TensorFlow version, it throws errors loading 2DFAN-1_keras.h5 or 2DFAN-2_keras.h5.

Requirements

  • Keras 2.2.4
  • TensorFlow 1.12.0 or 1.13.1

Acknowledgments

We learnt a lot from 1adrianb/face-alignment, zllrunning/face-parsing.PyTorch, swook/GazeML, deepinsight/insightface, davidsandberg/facenet, and ZhaoJ9014/face.evoLVe.PyTorch.

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