Repolode
yakhyo

yakhyo/uniface

A unified Python library for face detection, recognition, tracking, landmarks, parsing, gaze, attributes and anti-spoofing behind one API.

Stars
2,199
Forks
310
Open issues
5
Last commit
yesterday

What is it?

UniFace is a Python library for face analysis that bundles detection, recognition, tracking, facial landmarks, face mesh, parsing, matting, head pose, gaze, demographics, emotion, face states, quality scoring, anti-spoofing and anonymization under one interface. A FaceAnalyzer class runs detection, alignment and recognition in a single call, and attribute predictors such as FairFace or AgeGender can be added to fill in extra fields on each detected face.

Models run through ONNX Runtime on CPU, Apple Silicon and NVIDIA CUDA, and are installed with pip using either a cpu or gpu extra. Weights are downloaded on first use and checked with SHA-256. The model list includes RetinaFace, SCRFD, ArcFace, AdaFace, BiSeNet, MODNet and MiniFASNet, among others.

Some pretrained weights carry licences that differ from the library's MIT license, so the project asks users to review model licences before commercial use.

Key features

  • 01Detection, recognition and tracking in one FaceAnalyzer pipeline
  • 02Landmarks from 68 to 478 points, including 3D face mesh
  • 03Attribute predictors for age, sex, race, emotion and face states
  • 04Head pose and gaze estimation
  • 05Anti-spoofing, face quality scoring and five anonymization blur methods
  • 06Runs on CPU, Apple Silicon and CUDA via ONNX Runtime

Use cases

  • Adding face detection and recognition to a Python computer vision project
  • Building a video pipeline that tracks faces across frames
  • Anonymizing faces in photos or video footage
  • Running liveness checks alongside face matching

Quick start

  1. 1

    Install the CPU build (also works on Apple Silicon)

    pip install "uniface[cpu]"
  2. 2

    Or install the NVIDIA CUDA build instead

    pip install "uniface[gpu]"
  3. 3

    Run the first script: detect faces and print their attributes from a photo

Things to know

  • Some pretrained model weights are not MIT-licensed and need checking before commercial use.

In collections

Topics

#computer-vision#face-recognition#face-detection#onnxruntime#deep-learning#facial-landmarks#face-alignment#face-analysis#face-anonymization#face-anti-spoofing

FAQ

What is uniface?
A unified Python library for face detection, recognition, tracking, landmarks, parsing, gaze, attributes and anti-spoofing behind one API. UniFace is a Python library for face analysis that bundles detection, recognition, tracking, facial landmarks, face mesh, parsing, matting, head pose, gaze, demographics, emotion, face states, quality scoring, anti-spoofing and anonymization under one interface. A FaceAnalyzer class runs detection, alignment and recognition in a single call, and attribute predictors such as FairFace or AgeGender can be added to fill in extra fields on each detected face.
Is uniface free to use? What license does it have?
uniface is open source under the MIT license. Check the license terms before using it in commercial products.
Is uniface still maintained?
Actively maintained. The last commit to uniface was on Nov 6, 2026.
What can I use uniface for?
Adding face detection and recognition to a Python computer vision project Building a video pipeline that tracks faces across frames Anonymizing faces in photos or video footage Running liveness checks alongside face matching
How do I install uniface?
Install the CPU build (also works on Apple Silicon): pip install "uniface[cpu]" Or install the NVIDIA CUDA build instead: pip install "uniface[gpu]" Run the first script: detect faces and print their attributes from a photo
Where can I get uniface?
The source code and installation instructions are on GitHub: https://github.com/yakhyo/uniface

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects