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
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, and YOLOv5-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 | Face detection and landmarks | |
| 02_face_alignment.ipynb | Face alignment for recognition | |
| 03_face_verification.ipynb | Compare faces for identity | |
| 04_face_search.ipynb | Find a person in group photos | |
| 05_face_analyzer.ipynb | All-in-one analysis | |
| 06_face_parsing.ipynb | Semantic face segmentation | |
| 07_face_anonymization.ipynb | Privacy-preserving blur | |
| 08_gaze_estimation.ipynb | Gaze direction estimation |
References
- yakhyo/retinaface-pytorch — RetinaFace training
- yakhyo/yolov5-face-onnx-inference — YOLOv5-Face ONNX
- yakhyo/face-recognition — ArcFace, MobileFace, SphereFace
- yakhyo/face-parsing — BiSeNet face parsing
- yakhyo/gaze-estimation — MobileGaze training
- yakhyo/face-anti-spoofing — MiniFASNet inference
- yakhyo/fairface-onnx — FairFace attributes
- deepinsight/insightface — Model architectures
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uniface-2.1.0.tar.gz.
File metadata
- Download URL: uniface-2.1.0.tar.gz
- Upload date:
- Size: 64.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51794ba31fa676471bfa70f6d50783ef8f004f93ade5df0dd2d525e69fa9cf6c
|
|
| MD5 |
c14d7e6cba89acbdb709596a3de88e44
|
|
| BLAKE2b-256 |
0f73f8edfe6a2c93b7b1fc88c58a5e2bf99c28bcc21d96f0e7998e1acd479f84
|
File details
Details for the file uniface-2.1.0-py3-none-any.whl.
File metadata
- Download URL: uniface-2.1.0-py3-none-any.whl
- Upload date:
- Size: 77.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39a02281c959278a1b4f9c1801b53297ef93b7362cdf8869df84f70ba2ff7d90
|
|
| MD5 |
8c4bcb78bde46518a5fcd2c5dc544078
|
|
| BLAKE2b-256 |
c1d579b48ee9e42ce4243be8a75b21916a2b414fc2e7a7a7edc30ae750404437
|