yakhyo/uniface

A Unified Face Analysis Library for Python

What it solves

Traditional face-analysis pipelines force you to stitch together separate libraries for detection, recognition, tracking, landmark detection, and more. UniFace bundles fifteen common face tasks into one consistent Python package, so you can detect, recognize, track, parse, read attributes, verify liveness, and even anonymize faces with a single import and a unified API.

How it works

At the core is a FaceAnalyzer class. You create it with a list of "predictors" — each predictor handles a specific task like detection, recognition, or attribute extraction. For example, FaceAnalyzer(predictors=[FairFace()]) adds age, sex, and race prediction. Calling analyzer.analyze(image) runs detection, alignment, and recognition in one pass and returns a face object per detected face. Basic fields like bounding box, confidence, and landmarks are always populated; deeper attributes (age, emotion, liveness, etc.) only appear when you've supplied the predictor that computes them.

The library supports fifteen tasks, each with multiple model choices: detection (RetinaFace, SCRFD, etc.), recognition (AdaFace, ArcFace, ...), tracking with persistent IDs, 106/98/68-point landmarks, 3D face mesh, semantic face parsing, portrait matting, gaze and head pose estimation, demographics, emotion, face states (glasses, mask, etc.), image quality scoring, liveness anti-spoofing, anonymization (five blur methods), and FAISS-backed embedding search. It runs on CPU, Apple Silicon, and NVIDIA CUDA, and model weights are downloaded automatically on first use.

Who it's for

Developers building production face-related features — identity verification, video analytics, privacy protection, or research prototypes. It suits Python users who want a single, downloadable package (pip install "uniface[cpu]" or [gpu]) instead of assembling many separate model libraries. The optional attribute predictors let you keep startup fast and memory small.

Highlights

  • One FaceAnalyzer call covers detection, alignment, and recognition.
  • Fifteen tasks in one library: detection, recognition, tracking, landmarks, mesh, parsing, matting, gaze, head pose, demographics, emotion, face states, quality, anti-spoofing, anonymization, vector search.
  • Multiple model options per task (e.g., seven detectors, seven recognizers).
  • Works on CPU, Apple Silicon, and CUDA; weights auto-download.
  • Opt-in predictors: add heavy attribute models only when needed.
  • MIT-licensed core, though some pretrained weights carry separate licenses — check before commercial use.

Related

  • Project
  • Project
  • Project
  • Project
  • Project