Skip to main content

UniFace: A Comprehensive Library for Face Detection, Recognition, Landmark Analysis, Face Parsing, Gaze Estimation, Age, and Gender Detection

Project description

UniFace: All-in-One Face Analysis Library

PyPI Python License CI PyPI Downloads Docs

UniFace is a lightweight, production-ready face analysis library built on ONNX Runtime. It provides high-performance face detection, recognition, landmark detection, face parsing, gaze estimation, and attribute analysis with hardware acceleration support across platforms.

💬 Have questions? Chat with this codebase on DeepWiki - AI-powered docs that let you ask anything about UniFace.


Features

  • Face Detection — RetinaFace, SCRFD, YOLOv5-Face, and YOLOv8-Face with 5-point landmarks
  • Face Recognition — ArcFace, MobileFace, and SphereFace embeddings
  • Facial Landmarks — 106-point landmark localization
  • Face Parsing — BiSeNet semantic segmentation (19 classes)
  • Gaze Estimation — Real-time gaze direction with MobileGaze
  • Attribute Analysis — Age, gender, race (FairFace), and emotion
  • Anti-Spoofing — Face liveness detection with MiniFASNet
  • Face Anonymization — 5 blur methods for privacy protection
  • Hardware Acceleration — ARM64 (Apple Silicon), CUDA (NVIDIA), CPU

Installation

# Standard installation
pip install uniface

# GPU support (CUDA)
pip install uniface[gpu]

# From source
git clone https://github.com/yakhyo/uniface.git
cd uniface && pip install -e .

Quick Example

import cv2
from uniface import RetinaFace

# Initialize detector (models auto-download on first use)
detector = RetinaFace()

# Detect faces
image = cv2.imread("photo.jpg")
faces = detector.detect(image)

for face in faces:
    print(f"Confidence: {face.confidence:.2f}")
    print(f"BBox: {face.bbox}")
    print(f"Landmarks: {face.landmarks.shape}")

Documentation

📚 Full documentation: yakhyo.github.io/uniface

Resource Description
Quickstart Get up and running in 5 minutes
Model Zoo All models, benchmarks, and selection guide
API Reference Detailed module documentation
Tutorials Step-by-step workflow examples
Guides Architecture and design principles

Jupyter Notebooks

Example Colab Description
01_face_detection.ipynb Open In Colab Face detection and landmarks
02_face_alignment.ipynb Open In Colab Face alignment for recognition
03_face_verification.ipynb Open In Colab Compare faces for identity
04_face_search.ipynb Open In Colab Find a person in group photos
05_face_analyzer.ipynb Open In Colab All-in-one analysis
06_face_parsing.ipynb Open In Colab Semantic face segmentation
07_face_anonymization.ipynb Open In Colab Privacy-preserving blur
08_gaze_estimation.ipynb Open In Colab Gaze direction estimation

References


Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License.

Project details


Download files

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

Source Distribution

uniface-2.2.0.tar.gz (67.0 kB view details)

Uploaded Source

Built Distribution

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

uniface-2.2.0-py3-none-any.whl (83.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: uniface-2.2.0.tar.gz
  • Upload date:
  • Size: 67.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for uniface-2.2.0.tar.gz
Algorithm Hash digest
SHA256 0b570f4a3ba4b2b50faa093d518d0068b1bf5b537125af804ac5f726d225b911
MD5 646970dc99dfe514d65376ae7ec37ffc
BLAKE2b-256 26acffe5818a0ff2b2cc4e6e47ab56c3eb668de6081c6cfeb6d6c030281d7b93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uniface-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 83.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for uniface-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f295c906871e1c740bfd41abb97af6d9ac1266ac0c39d9f4e4eb95b4a6d07a23
MD5 a7f3afae1874a921cd2a011931d9451f
BLAKE2b-256 5718653289ac00e618053bdda168f1dcc79fe2df03247b7fdbf315a4fda987bc

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 Pingdom Monitoring Sentry Error logging StatusPage Status page