All Projects → patlevin → face-detection-tflite

patlevin / face-detection-tflite

Licence: MIT license
Face and iris detection for Python based on MediaPipe

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to face-detection-tflite

Open nsfw android
🔥🔥🔥色情图片离线识别,基于TensorFlow实现。识别只需20ms,可断网测试,成功率99%,调用只要一行代码,从雅虎的开源项目open_nsfw移植,该模型文件可用于iOS、java、C++等平台
Stars: ✭ 1,586 (+1933.33%)
Mutual labels:  tensorflow-models, tensorflow-lite
Age-Gender Estimation TF-Android
Age + Gender Estimation on Android with TensorFlow Lite
Stars: ✭ 34 (-56.41%)
Mutual labels:  tensorflow-models, tensorflow-lite
FaceIDLight
A lightweight face-recognition toolbox and pipeline based on tensorflow-lite
Stars: ✭ 17 (-78.21%)
Mutual labels:  face-detection, tensorflow-lite
Agender
Real-time estimation of gender and age
Stars: ✭ 95 (+21.79%)
Mutual labels:  face-detection, tensorflow-models
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 (-70.51%)
Mutual labels:  face-detection
Face-Recognition-Attendance-System
Face Detection | Recognition | Attendance
Stars: ✭ 289 (+270.51%)
Mutual labels:  face-detection
Traffic-Light-Classification
A detailed tutorial on how to build a traffic light classifier with TensorFlow for the capstone project of Udacity's Self-Driving Car Engineer Nanodegree Program.
Stars: ✭ 110 (+41.03%)
Mutual labels:  tensorflow-models
Neural-Turing-Machine
TensorFlow implementation of a Neural Turing Machine
Stars: ✭ 23 (-70.51%)
Mutual labels:  tensorflow-models
gans-2.0
Generative Adversarial Networks in TensorFlow 2.0
Stars: ✭ 76 (-2.56%)
Mutual labels:  tensorflow-models
UltraFaceDotNet
C# version of Ultra-Light-Fast-Generic-Face-Detector-1MB for Windows, MacOS, Linux, iOS and Android
Stars: ✭ 56 (-28.21%)
Mutual labels:  face-detection
deep utils
An open-source toolkit which is full of handy functions, including the most used models and utilities for deep-learning practitioners!
Stars: ✭ 73 (-6.41%)
Mutual labels:  face-detection
deface
Video anonymization by face detection
Stars: ✭ 269 (+244.87%)
Mutual labels:  face-detection
quickstart-android
Quick start examples for Banuba Face AR SDK on Android
Stars: ✭ 17 (-78.21%)
Mutual labels:  face-detection
Machine-Learning-Notebooks
15+ Machine/Deep Learning Projects in Ipython Notebooks
Stars: ✭ 66 (-15.38%)
Mutual labels:  tensorflow-models
MOS-Multi-Task-Face-Detect
Code for BMVC2021 "MOS: A Low Latency and Lightweight Framework for Face Detection, Landmark Localization, and Head Pose Estimation"
Stars: ✭ 104 (+33.33%)
Mutual labels:  face-detection
face detection
Face detection in live video
Stars: ✭ 38 (-51.28%)
Mutual labels:  face-detection
TensorFlow
Swift high-level API for TensorFlow.
Stars: ✭ 49 (-37.18%)
Mutual labels:  tensorflow-models
android-yoonit-facefy
The face detection's module for Android with a lot of awesome features
Stars: ✭ 39 (-50%)
Mutual labels:  face-detection
ova-server
OpenVisionAPI server
Stars: ✭ 93 (+19.23%)
Mutual labels:  tensorflow-lite
TPU-MobilenetSSD
Edge TPU Accelerator / Multi-TPU + MobileNet-SSD v2 + Python + Async + LattePandaAlpha/RaspberryPi3/LaptopPC
Stars: ✭ 82 (+5.13%)
Mutual labels:  tensorflow-lite

Face Detection For Python

This package implements parts of Google®'s MediaPipe models in pure Python (with a little help from Numpy and PIL) without Protobuf graphs and with minimal dependencies (just TF Lite and Pillow).

Models and Examples

The package provides the following models:

  • Face Detection

Face detection example

  • Face Landmark Detection

Face landmark example

  • Iris Landmark Detection

Iris landmark example

  • Iris recoloring example

Iris recoloring example

Motivation

The package doesn't use the graph approach implemented by MediaPipe and is therefore not as flexible. It is, however, somewhat easier to use and understand and more accessible to recreational programming and experimenting with the pretrained ML models than the rather complex MediaPipe framework.

Here's how face detection works and an image like shown above can be produced:

from fdlite import FaceDetection, FaceDetectionModel
from fdlite.render import Colors, detections_to_render_data, render_to_image 
from PIL import Image

image = Image.open('group.jpg')
detect_faces = FaceDetection(model_type=FaceDetectionModel.BACK_CAMERA)
faces = detect_faces(image)
if not len(faces):
    print('no faces detected :(')
else:
    render_data = detections_to_render_data(faces, bounds_color=Colors.GREEN)
    render_to_image(render_data, image).show()

While this example isn't that much simpler than the MediaPipe equivalent, some models (e.g. iris detection) aren't available in the Python API.

Note that the package ships with five models:

  • FaceDetectionModel.FRONT_CAMERA - a smaller model optimised for selfies and close-up portraits; this is the default model used
  • FaceDetectionModel.BACK_CAMERA - a larger model suitable for group images and wider shots with smaller faces
  • FaceDetectionModel.SHORT - a model best suited for short range images, i.e. faces are within 2 metres from the camera
  • FaceDetectionModel.FULL - a model best suited for mid range images, i.e. faces are within 5 metres from the camera
  • FaceDetectionModel.FULL_SPARSE - a model best suited for mid range images, i.e. faces are within 5 metres from the camera

The FaceDetectionModel.FULL and FaceDetectionModel.FULL_SPARSE models are equivalent in terms of detection quality. They differ in that the full model is a dense model whereas the sparse model runs up to 30% faster on CPUs. On a GPU, both models exhibit similar runtime performance. In addition, the dense full model has slightly better Recall, whereas the sparse model features a higher Precision.

If you don't know whether the image is a close-up portrait or you get no detections with the default model, try using the BACK_CAMERA-model instead.

Installation

The latest release version is available in PyPI and can be installed via:

pip install -U face-detection-tflite

The package can be also installed from source by navigating to the folder containing setup.py and running

pip install .

from a shell or command prompt.

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