Socket
Book a DemoInstallSign in
Socket

uniface

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uniface

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

pipPyPI
Version
2.2.0
Maintainers
1

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

ResourceDescription
QuickstartGet up and running in 5 minutes
Model ZooAll models, benchmarks, and selection guide
API ReferenceDetailed module documentation
TutorialsStep-by-step workflow examples
GuidesArchitecture and design principles

Jupyter Notebooks

ExampleColabDescription
01_face_detection.ipynbOpen In ColabFace detection and landmarks
02_face_alignment.ipynbOpen In ColabFace alignment for recognition
03_face_verification.ipynbOpen In ColabCompare faces for identity
04_face_search.ipynbOpen In ColabFind a person in group photos
05_face_analyzer.ipynbOpen In ColabAll-in-one analysis
06_face_parsing.ipynbOpen In ColabSemantic face segmentation
07_face_anonymization.ipynbOpen In ColabPrivacy-preserving blur
08_gaze_estimation.ipynbOpen In ColabGaze direction estimation

References

Contributing

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

License

This project is licensed under the MIT License.

Keywords

face-detection

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts