A lite C++ toolkit of 100+ AI models for detection, face recognition, segmentation and matting, running on ONNXRuntime, MNN, TensorRT and others.
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
Install the CPU build (also works on Apple Silicon)
pip install "uniface[cpu]" - 2
Or install the NVIDIA CUDA build instead
pip install "uniface[gpu]" - 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
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
A Python library for face recognition and facial attribute analysis, covering age, gender, emotion and race, with multiple pluggable models and detectors.
Self-hosted, offline-capable photo and video library that uses local AI for face recognition and semantic search.
An AI deployment framework with a visual drag-and-drop workflow editor, running models across desktop, mobile, edge and server hardware via multiple inference engines.
A Python toolkit that optimizes ONNX models by reducing operator count while keeping accuracy, aiming for faster inference.
Self-hosted, local-only NVR and AI computer vision software for object, motion and face detection on your own cameras.