A Unified Face Analysis Library for Python
English · 简体中文 · 한국어 · Oʻzbekcha
UniFace is a lightweight, production-ready Python library for face detection, recognition,
tracking, landmarks, face mesh, parsing, gaze, attributes, anti-spoofing and more.
Nine of the fifteen tasks, one library. Every overlay is UniFace output, rendered frame by frame.
pip install "uniface[cpu]" # CPU and Apple Silicon
pip install "uniface[gpu]" # NVIDIA CUDA
pip install --pre "uniface[cpu]" # latest pre-releaseFaceAnalyzer runs detection, alignment and recognition in one call. Attribute models are opt-in.
import cv2
from uniface import FaceAnalyzer, FairFace
analyzer = FaceAnalyzer(predictors=[FairFace()])
for face in analyzer.analyze(cv2.imread("photo.jpg")):
print(face.bbox, face.sex, face.age_group, face.embedding.shape)bbox, confidence and landmarks are always set, and embedding is set whenever a recognizer runs,
which is the default. Age, sex, race, emotion and the face states stay None until you pass the predictor
that fills them.
All fifteen tasks, and which model does each
| Task | Models |
|---|---|
| Face Detection | RetinaFace, SCRFD, CenterFace, YOLOv5-Face, YOLOv8-Face, BlazeFace |
| Face Recognition | AdaFace, ArcFace, AuraFace, EdgeFace, HyperFace, MobileFace, SphereFace |
| Face Tracking | BYTETracker, persistent IDs across video frames |
| Facial Landmarks | 2d106det (106), PIPNet (98 / 68), Face Mesh (468 / 478, 3D) |
| Face Parsing | BiSeNet (19 classes), XSeg masking |
| Portrait Matting | MODNet, PP-Matting (v1 HRNet-W18, v2 STDC1), trimap-free |
| Gaze Estimation | MobileGaze (ResNet-18 / 34 / 50, MobileNetV2, MobileOne-S0) |
| Head Pose | 6D rotation representation, pitch / yaw / roll |
| Demographics | AgeGender, FairFace (age group, sex, race) |
| Emotion | AffectNet-7 and AffectNet-8 |
| Face States | FaceAttribNet: eyes, glasses, sunglasses, mask |
| Face Quality | eDifFIQA (T / S / M / L) |
| Anti-Spoofing | MiniFASNet liveness |
| Anonymization | 5 blur methods |
| Vector Store | FAISS-backed embedding search |
Runs on CPU, Apple Silicon and CUDA. Weights download on first use.
Face Detection · docs
Facial Landmarks · docs
Face Mesh · docs
Face Quality · docs
Face Parsing · docs
Face Segmentation · docs
Portrait Matting · docs
Head Pose · docs
Gaze Estimation · docs
Age and Sex · docs
Emotion · docs
Face States · docs
Anti-Spoofing · docs
Face Recognition · docs
Face Anonymization · docs