All Projects → littletomatodonkey → insight-face-paddle

littletomatodonkey / insight-face-paddle

Licence: Apache-2.0 license
End-to-end face detection and recognition system using PaddlePaddle.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to insight-face-paddle

PaddlePaddle-MTCNN
基于PaddlePaddle复现的MTCNN人脸检测模型
Stars: ✭ 23 (-55.77%)
Mutual labels:  face-detection, paddlepaddle
retinaface
RetinaFace: Deep Face Detection Library for Python
Stars: ✭ 242 (+365.38%)
Mutual labels:  face-detection, insightface
Facial-Recognition-Attendance-System
An attendance system which uses facial recognition to detect which people are present in any image.
Stars: ✭ 48 (-7.69%)
Mutual labels:  face-detection, face-api
Insightface
State-of-the-art 2D and 3D Face Analysis Project
Stars: ✭ 10,886 (+20834.62%)
Mutual labels:  face-detection, paddlepaddle
Paddledetection
Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Stars: ✭ 5,799 (+11051.92%)
Mutual labels:  face-detection, blazeface
Tenginekit
TengineKit - Free, Fast, Easy, Real-Time Face Detection & Face Landmarks & Face Attributes & Hand Detection & Hand Landmarks & Body Detection & Body Landmarks & Iris Landmarks & Yolov5 SDK On Mobile.
Stars: ✭ 2,103 (+3944.23%)
Mutual labels:  face-detection, face-api
compreface-javascript-sdk
JavaScript SDK for CompreFace - free and open-source face recognition system from Exadel
Stars: ✭ 19 (-63.46%)
Mutual labels:  face-detection, insightface
FaceRecognitionCpp
Large input size REAL-TIME Face Detector on Cpp. It can also support face verification using MobileFaceNet+Arcface with real-time inference. 480P Over 30FPS on CPU
Stars: ✭ 40 (-23.08%)
Mutual labels:  face-detection, insightface
InsightFace-REST
InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Stars: ✭ 308 (+492.31%)
Mutual labels:  face-detection, insightface
deepvisualminer
Deep visual mining for your photos and videos using YOLOv2 deep convolutional neural network based object detector and traditional face recognition algorithms
Stars: ✭ 21 (-59.62%)
Mutual labels:  face-detection
PCN-Windows
No description or website provided.
Stars: ✭ 21 (-59.62%)
Mutual labels:  face-detection
enjoytheshow
Real-time facial expression gathering
Stars: ✭ 32 (-38.46%)
Mutual labels:  face-api
TakeASelfie
An iOS framework that uses the front camera, detects your face and takes a selfie.
Stars: ✭ 36 (-30.77%)
Mutual labels:  face-detection
ARFaceFilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 72 (+38.46%)
Mutual labels:  face-detection
Warhol
Face Detection Made Easy on iOS
Stars: ✭ 25 (-51.92%)
Mutual labels:  face-detection
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 (+30.77%)
Mutual labels:  face-detection
terran
A human perception library
Stars: ✭ 98 (+88.46%)
Mutual labels:  face-detection
Cat-Face-Detector-with-OpenCV-and-JavaFX
📹 A Small OpenCV (Open Source Computer Vision) Example, who has the ability to detect multiple cat faces at the same time 🐱
Stars: ✭ 24 (-53.85%)
Mutual labels:  face-detection
Face-Recognition
Machine Learning project to recognise faces from an Image just like facebook or video stream
Stars: ✭ 95 (+82.69%)
Mutual labels:  face-detection
Face-Recognition-using-Raspberry-Pi
A small project which does face detection using OpenCV library.
Stars: ✭ 48 (-7.69%)
Mutual labels:  face-detection

简体中文 | English


InsightFace Paddle

1. Introduction

1.1 Overview

InsightFacePaddle is an open source deep face detection and recognition toolkit, powered by PaddlePaddle. InsightFacePaddle provide three related pretrained models now, include BlazeFace for face detection, ArcFace and MobileFace for face recognition.

1.2 Benchmark

For face detection task, on WiderFace dataset, the following table shows mAP, speed and time cost for BlazeFace.

Model structure Model size WiderFace mAP CPU time cost GPU time cost
BlazeFace-FPN-SSH-Paddle 0.65MB 0.9187/0.8979/0.8168 31.7ms 5.6ms
RetinaFace 1.68MB -/-/0.825 182.0ms 17.4ms

For face recognition task, on MSAM dataset, the following table shows precision, speed and time cost for MobileFaceNet.

Model structure lfw cfp_fp agedb30 CPU time cost GPU time cost
MobileFaceNet-Paddle 0.9945 0.9343 0.9613 4.3ms 2.3ms
MobileFaceNet-mxnet 0.9950 0.8894 0.9591 7.3ms 4.7ms

Benchmark environment:

  • CPU: Intel(R) Xeon(R) Gold 6184 CPU @ 2.40GHz
  • GPU: a single NVIDIA Tesla V100

Note: Performance of RetinaFace is tested using script test.py. The image shape is modified to 640x480 here. Performance of MobileFaceNet-mxnet is tested using script verification.py.

1.3 Visualization

One example result predicted by InsightFacePaddle is as follow. Please refer to the Demo for more.

1.4 Community

Scan the QR code below with your QQ (QQ group number: 705899115) to discuss more about deep learning together.

2. Installation

  1. Install PaddlePaddle

PaddlePaddle 2.1 or later is required for InsightFacePaddle. You can use the following steps to install PaddlePaddle.

# for GPU
pip3 install paddlepaddle-gpu

# for CPU
pip3 install paddlepaddle

For more details about installation. please refer to PaddlePaddle.

  1. Install requirements

InsightFacePaddle dependencies are listed in requirements.txt, you can use the following command to install the dependencies.

pip3 install --upgrade -r requirements.txt -i https://mirror.baidu.com/pypi/simple
  1. Install InsightFacePaddle
  • [Recommanded] You can use pip to install the lastest version InsightFacePaddle from pypi.
pip3 install --upgrade insightface-paddle
  • You can also build whl package and install by following commands.
cd ./InsightFacePaddle
python3 setup.py bdist_wheel
pip3 install dist/*

3. Quick Start

InsightFacePaddle support two ways of use, including Commad Line and Python API.

3.1 Command Line

You can use InsightFacePaddle in Command Line.

3.1.1 Get help

You can get the help about InsightFacePaddle by following command.

insightfacepaddle -h

The args are as follows:

args type default help
det_model str BlazeFace The detection model.
rec_model str MobileFace The recognition model.
use_gpu bool True Whether use GPU to predict. Default by True.
enable_mkldnn bool False Whether use MKLDNN to predict, valid only when --use_gpu is False. Default by False.
cpu_threads int 1 The num of threads with CPU, valid only when --use_gpu is False and --enable_mkldnn is True. Default by 1.
input str - The path of video to be predicted. Or the path or directory of image file(s) to be predicted.
output str - The directory to save prediction result.
det bool False Whether to detect.
det_thresh float 0.8 The threshold of detection postprocess. Default by 0.8.
rec bool False Whether to recognize.
index str - The path of index file.
cdd_num int 5 The number of candidates in the recognition retrieval. Default by 5.
rec_thresh float 0.45 The threshold of match in recognition, use to remove candidates with low similarity. Default by 0.45.
max_batch_size int 1 The maxium of batch_size to recognize. Default by 1.
build_index str - The path of index to be build.
img_dir str - The img(s) dir used to build index.
label str - The label file path used to build index.

3.1.2 Build index

If use recognition, before start predicting, you have to build the index.

insightfacepaddle --build_index ./demo/friends/index.bin --img_dir ./demo/friends/gallery --label ./demo/friends/gallery/label.txt

An example used to build index is as follows:

3.1.3 Predict

  1. Detection only
  • Image(s)

Use the image below to predict:

The prediction command:

insightfacepaddle --det --input ./demo/friends/query/friends1.jpg --output ./output

The result is under the directory ./output:

  • Video
insightfacepaddle --det --input ./demo/friends/query/friends.mp4 --output ./output
  1. Recognition only
  • Image(s)

Use the image below to predict:

The prediction command:

insightfacepaddle --rec --index ./demo/friends/index.bin --input ./demo/friends/query/Rachel.png

The result is output in the terminal:

INFO:root:File: Rachel., predict label(s): ['Rachel']
  1. Detection and recognition
  • Image(s)

Use the image below to predict:

The prediction command:

insightfacepaddle --det --rec --index ./demo/friends/index.bin --input ./demo/friends/query/friends2.jpg --output ./output

The result is under the directory ./output:

  • Video
insightfacepaddle --det --rec --index ./demo/friends/index.bin --input ./demo/friends/query/friends.mp4 --output ./output

3.2 Python

You can use InsightFacePaddle in Python. First, import InsightFacePaddle and logging because InsightFacePaddle using that to control log.

import insightface_paddle as face
import logging
logging.basicConfig(level=logging.INFO)

3.2.1 Get help

parser = face.parser()
help_info = parser.print_help()
print(help_info)

3.2.2 Building index

parser = face.parser()
args = parser.parse_args()
args.build_index = "./demo/friends/index.bin"
args.img_dir = "./demo/friends/gallery"
args.label = "./demo/friends/gallery/label.txt"
predictor = face.InsightFace(args)
predictor.build_index()

3.2.3 Prediction

  1. Detection only
  • Image(s)
parser = face.parser()
args = parser.parse_args()

args.det = True
args.output = "./output"
input_path = "./demo/friends/query/friends1.jpg"

predictor = face.InsightFace(args)
res = predictor.predict(input_path)
print(next(res))
  • NumPy
import cv2

parser = face.parser()
args = parser.parse_args()

args.det = True
args.output = "./output"
path = "./demo/friends/query/friends1.jpg"
img = cv2.imread(path)[:, :, ::-1]

predictor = face.InsightFace(args)
res = predictor.predict(img)
print(next(res))

The prediction result saved as "./output/tmp.png".

  • Video
parser = face.parser()
args = parser.parse_args()

args.det = True
args.output = "./output"
input_path = "./demo/friends/query/friends.mp4"

predictor = face.InsightFace(args)
res = predictor.predict(input_path)
for _ in res:
    print(_)
  1. Recognition only
  • Image(s)
parser = face.parser()
args = parser.parse_args()

args.rec = True
args.index = "./demo/friends/index.bin"
input_path = "./demo/friends/query/Rachel.png"

predictor = face.InsightFace(args)
res = predictor.predict(input_path, print_info=True)
next(res)
  • NumPy
import cv2

parser = face.parser()
args = parser.parse_args()

args.rec = True
args.index = "./demo/friends/index.bin"
path = "./demo/friends/query/Rachel.png"
img = cv2.imread(path)[:, :, ::-1]

predictor = face.InsightFace(args)
res = predictor.predict(img, print_info=True)
next(res)
  1. Detection and recognition
  • Image(s)
parser = face.parser()
args = parser.parse_args()

args.det = True
args.rec = True
args.index = "./demo/friends/index.bin"
args.output = "./output"
input_path = "./demo/friends/query/friends2.jpg"

predictor = face.InsightFace(args)
res = predictor.predict(input_path, print_info=True)
next(res)
  • NumPy
import cv2

parser = face.parser()
args = parser.parse_args()

args.det = True
args.rec = True
args.index = "./demo/friends/index.bin"
args.output = "./output"
path = "./demo/friends/query/friends2.jpg"
img = cv2.imread(path)[:, :, ::-1]

predictor = face.InsightFace(args)
res = predictor.predict(img, print_info=True)
next(res)

The prediction result saved as "./output/tmp.png".

  • Video
parser = face.parser()
args = parser.parse_args()

args.det = True
args.rec = True
args.index = "./demo/friends/index.bin"
args.output = "./output"
input_path = "./demo/friends/query/friends.mp4"

predictor = face.InsightFace(args)
res = predictor.predict(input_path, print_info=True)
for _ in res:
    pass
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].