Skip to main content

UniFace: A Unified Face Analysis Library for Python

PyPI Version Python Version License Github Build Status PyPI Downloads Kaggle Badge

UniFace - A Unified Face Analysis Library for Python

UniFace is a lightweight, production-ready Python library for face detection, recognition,
tracking, landmark analysis, face parsing, gaze estimation, and face attributes.

Get Started   Model Zoo   Notebooks   Full Docs

pip install "uniface[cpu]"          # CPU and Apple Silicon
pip install "uniface[gpu]"          # NVIDIA CUDA
pip install --pre "uniface[cpu]"    # latest pre-release
A first script

FaceAnalyzer 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, landmarks and embedding are always set. Age, sex, race, emotion, quality 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, EdgeFace, 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, trimap-free
Gaze Estimation MobileGaze (ResNet-18 / 34 / 50, MobileNetV2)
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, verified by SHA-256.


Find and measure faces

Face Detection  ·  docs

Facial Landmarks  ·  docs

Face Mesh  ·  docs

Face Quality  ·  docs

Cut faces out

Face Parsing  ·  docs

Face Segmentation  ·  docs

Portrait Matting  ·  docs

Read where a head is pointing

Head Pose  ·  docs

Gaze Estimation  ·  docs

Read a face

Age and Sex  ·  docs

Emotion  ·  docs

Face States  ·  docs

Tell a real face from a replay

Anti-Spoofing  ·  docs

Match a face, or hide one

Face Recognition  ·  docs

Face Anonymization  ·  docs


Get Started  ·  Model Zoo  ·  Notebooks  ·  Model licences  ·  Contributing  ·  Discord  ·  Issues

Runs on CPU, Apple Silicon and CUDA. Weights download on first use, verified by SHA-256.
UniFace is MIT; some pretrained weights are not, so check licences before shipping commercially.
Not affiliated with Uniface by Rocket Software.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uniface-4.0.0.tar.gz (134.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uniface-4.0.0-py3-none-any.whl (160.4 kB view details)

Uploaded Python 3

File details

Details for the file uniface-4.0.0.tar.gz.

File metadata

  • Download URL: uniface-4.0.0.tar.gz
  • Upload date:
  • Size: 134.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for uniface-4.0.0.tar.gz
Algorithm Hash digest
SHA256 12f90f11b4d921d8a54ce88c698c29c7da373afec465f280c4fc7c2d6a3ae543
MD5 5989fba4f84657d3d46cd660bfe45a4e
BLAKE2b-256 ec37a3362a8e570799ff981bf0410a7492f50447d416b24f6a4da6123fd72312

See more details on using hashes here.

File details

Details for the file uniface-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: uniface-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 160.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for uniface-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dce410a2a1dddaec156b8d279cce5b8814c3e677d199e7d403fd7403852b66b
MD5 bf770c76bb6bd21112ca0cfc3ac025fc
BLAKE2b-256 2170255794e8040fd9e08068056d1607147d3055b82890d8c95cd600b0eb8f95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page