All Projects → serengil → retinaface

serengil / retinaface

Licence: MIT License
RetinaFace: Deep Face Detection Library for Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to retinaface

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 (-83.47%)
Mutual labels:  face-recognition, face-detection, insightface, retinaface, retinaface-detector
Insightface
State-of-the-art 2D and 3D Face Analysis Project
Stars: ✭ 10,886 (+4398.35%)
Mutual labels:  face-recognition, face-detection, face-alignment, retinaface
InsightFace-REST
InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Stars: ✭ 308 (+27.27%)
Mutual labels:  face-recognition, face-detection, insightface, retinaface
Pyseeta
python api for SeetaFaceEngine(https://github.com/seetaface/SeetaFaceEngine.git)
Stars: ✭ 93 (-61.57%)
Mutual labels:  face-recognition, face-detection, face-alignment
lite.ai.toolkit
🛠 A lite C++ toolkit of awesome AI models with ONNXRuntime, NCNN, MNN and TNN. YOLOX, YOLOP, MODNet, YOLOR, NanoDet, YOLOX, SCRFD, YOLOX . MNN, NCNN, TNN, ONNXRuntime, CPU/GPU.
Stars: ✭ 1,354 (+459.5%)
Mutual labels:  face-recognition, face-detection, retinaface
compreface-javascript-sdk
JavaScript SDK for CompreFace - free and open-source face recognition system from Exadel
Stars: ✭ 19 (-92.15%)
Mutual labels:  face-recognition, face-detection, insightface
Facepapercollection
A collection of face related papers
Stars: ✭ 241 (-0.41%)
Mutual labels:  face-recognition, face-detection, face-alignment
Deep Face Recognition
One-shot Learning and deep face recognition notebooks and workshop materials
Stars: ✭ 147 (-39.26%)
Mutual labels:  face-recognition, face-detection, face-alignment
Awesome Face recognition
papers about Face Detection; Face Alignment; Face Recognition && Face Identification && Face Verification && Face Representation; Face Reconstruction; Face Tracking; Face Super-Resolution && Face Deblurring; Face Generation && Face Synthesis; Face Transfer; Face Anti-Spoofing; Face Retrieval;
Stars: ✭ 3,220 (+1230.58%)
Mutual labels:  face-recognition, face-detection, face-alignment
Face-Recognition-Raspberry-Pi-64-bits
Recognize 2000+ faces on your Raspberry Pi 4 with database auto-fill and anti-spoofing
Stars: ✭ 48 (-80.17%)
Mutual labels:  face-recognition, face-detection, retinaface
DeepVTB
🌌 OpenVTuber-虚拟アイドル共享计划 An application of real-time face and gaze analyzation via deep nerual networks.
Stars: ✭ 32 (-86.78%)
Mutual labels:  face-detection, face-alignment, retinaface
iqiyi-vid-challenge
Code for IQIYI-VID(IQIYI Video Person Identification) Challenge Implemented in Python and MXNet
Stars: ✭ 45 (-81.4%)
Mutual labels:  face-recognition, face-detection, face-alignment
Face.evolve.pytorch
🔥🔥High-Performance Face Recognition Library on PaddlePaddle & PyTorch🔥🔥
Stars: ✭ 2,719 (+1023.55%)
Mutual labels:  face-recognition, face-detection, face-alignment
Face Alignment
🔥 2D and 3D Face alignment library build using pytorch
Stars: ✭ 5,417 (+2138.43%)
Mutual labels:  face-detector, face-detection, face-alignment
Face-Recognition-Jetson-Nano
Recognize 2000+ faces on your Jetson Nano with database auto-fill and anti-spoofing
Stars: ✭ 63 (-73.97%)
Mutual labels:  face-recognition, face-detection, retinaface
GenderRecognizer
Plain Face Detector & Gender Recognizer
Stars: ✭ 57 (-76.45%)
Mutual labels:  face-detector, face-recognition, face-detection
WreckFaceApp
Android application for gender, age and face recognition using OpenCV and JavaCV libraries
Stars: ✭ 21 (-91.32%)
Mutual labels:  face-recognition, face-detection
Face Detection HOG
Face Detection using HOG and SVM
Stars: ✭ 13 (-94.63%)
Mutual labels:  face-recognition, face-detection
Look4Face
Demo of Face Recognition web service
Stars: ✭ 23 (-90.5%)
Mutual labels:  face-recognition, face-detection
face-recognition
🙂 An OpenCV application that can detect & recognize your face in real-time
Stars: ✭ 13 (-94.63%)
Mutual labels:  face-recognition, face-detection

RetinaFace

Downloads Stars License Support me on Patreon Twitter DOI

RetinaFace is a deep learning based cutting-edge facial detector for Python coming with facial landmarks. Its detection performance is amazing even in the crowd as shown in the following illustration.

RetinaFace is the face detection module of insightface project. The original implementation is mainly based on mxnet. Then, its tensorflow based re-implementation is published by Stanislas Bertrand. So, this repo is heavily inspired from the study of Stanislas Bertrand. Its source code is simplified and it is transformed to pip compatible but the main structure of the reference model and its pre-trained weights are same.

Installation

The easiest way to install retinaface is to download it from PyPI. It's going to install the library itself and its prerequisites as well.

pip install retina-face

Then, you will be able to import the library and use its functionalities.

from retinaface import RetinaFace

Face Detection - Demo

RetinaFace offers a face detection function. It expects an exact path of an image as input.

resp = RetinaFace.detect_faces("img1.jpg")

Then, it will return the facial area coordinates and some landmarks (eyes, nose and mouth) with a confidence score.

{
    "face_1": {
        "score": 0.9993440508842468,
        "facial_area": [155, 81, 434, 443],
        "landmarks": {
          "right_eye": [257.82974, 209.64787],
          "left_eye": [374.93427, 251.78687],
          "nose": [303.4773, 299.91144],
          "mouth_right": [228.37329, 338.73193],
          "mouth_left": [320.21982, 374.58798]
        }
  }
}

Alignment - Tutorial, Demo

A modern face recognition pipeline consists of 4 common stages: detect, align, normalize, represent and verify. Experiments show that alignment increases the face recognition accuracy almost 1%. Here, retinaface can find the facial landmarks including eye coordinates. In this way, it can apply alignment to detected faces with its extracting faces function.

import matplotlib.pyplot as plt
faces = RetinaFace.extract_faces(img_path = "img.jpg", align = True)
for face in faces:
  plt.imshow(face)
  plt.show()

Face Recognition - Demo

Notice that face recognition module of insightface project is ArcFace, and face detection module is RetinaFace. ArcFace and RetinaFace pair is wrapped in deepface library for Python. Consider to use deepface if you need an end-to-end face recognition pipeline.

#!pip install deepface
from deepface import DeepFace
obj = DeepFace.verify("img1.jpg", "img2.jpg"
          , model_name = 'ArcFace', detector_backend = 'retinaface')
print(obj["verified"])

Notice that ArcFace got 99.40% accuracy on LFW data set whereas human beings just have 97.53% confidence.

Support

There are many ways to support a project. Starring⭐️ the repo is just one 🙏

You can also support this work on Patreon

Acknowledgements

This work is mainly based on the insightface project and retinaface paper; and it is heavily inspired from the re-implementation of retinaface-tf2 by Stanislas Bertrand. Finally, Bertrand's implemenation uses Fast R-CNN written by Ross Girshick in the background. All of those reference studies are licensed under MIT license.

Citation

If you are using RetinaFace in your research, please consider to cite its original research paper. Besides, if you are using this re-implementation of retinaface, please consider to cite the following research paper as well. Here is an example of BibTeX entry:

@inproceedings{serengil2021lightface,
  title        = {HyperExtended LightFace: A Facial Attribute Analysis Framework},
  author       = {Serengil, Sefik Ilkin and Ozpinar, Alper},
  booktitle    = {2021 International Conference on Engineering and Emerging Technologies (ICEET)},
  pages        = {1-4},
  year         = {2021},
  doi          = {10.1109/ICEET53442.2021.9659697},
  url          = {https://doi.org/10.1109/ICEET53442.2021.9659697},
  organization = {IEEE}
}

Finally, if you use this RetinaFace re-implementation in your GitHub projects, please add retina-face dependency in the requirements.txt.

Licence

This project is licensed under the MIT License - see LICENSE for more details.

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