Skip to content

Releases: yakhyo/uniface

v1.3.1

09 Dec 15:20
3982d67

Choose a tag to compare

What's Changed

  • fix: Fix type conversion and remove redundant type conversion by @yakhyo in #29

Full Changelog: v1.3.0...v1.3.1

v1.3.0

07 Dec 10:54
637316f

Choose a tag to compare

What's Changed

  • feat: Update examples and some minor changes to UniFace API by @yakhyo in #28

Full Changelog: v1.2.0...v1.3.0

v1.2.0

03 Dec 14:39
6b1d2a1

Choose a tag to compare

What's Changed

  • feat: Add YOLOv5 face detection support by @yakhyo in #26

Full Changelog: v1.1.2...v1.2.0

v1.1.2

30 Nov 11:34
0c93598

Choose a tag to compare

What's Changed

  • feat: Some minor changes to code style and warning supression by @yakhyo in #23
  • feat: Enhace emotion inference speed on ARM and add FaceAnalyzer, Face classes for ease of use. by @yakhyo in #25

Full Changelog: v1.1.1...v1.1.2

v1.1.1

25 Nov 15:18

Choose a tag to compare

Full Changelog: v1.1.0...v1.1.1

v1.1.0

15 Nov 12:34
11363fe

Choose a tag to compare

What's Changed

  • ref: Add comprehensive test suite and enhance model functionality by @yakhyo in #18

Full Changelog: v0.1.9...v1.1.0

Model Weights

20 Nov 08:52

Choose a tag to compare

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

Features

  • High-speed face detection using ONNX models (Added: 2024-11-20)
  • Accurate facial landmark localization (e.g., eyes, nose, and mouth) (Added: 2024-11-20)
  • Face recognition with multiple model options (Added: 2024-11-20)
  • Age and gender detection (Added: 2024-11-20)
  • Emotion recognition (Added: 2024-11-20)
  • Easy-to-use API for inference and visualization (Added: 2024-11-20)

Available Models

Face Detection Models

RetinaFace Models

Model Name Easy Medium Hard Use Case
retinaface_mnet025 88.48% 87.02% 80.61% Mobile/Edge devices
retinaface_mnet050 89.42% 87.97% 82.40% Mobile/Edge devices
retinaface_mnet_v1 90.59% 89.14% 84.13% Balanced mobile
retinaface_mnet_v2 91.70% 91.03% 86.60% Recommended default
retinaface_r18 92.50% 91.02% 86.63% Server/High accuracy
retinaface_r34 94.16% 93.12% 88.90% Maximum accuracy

SCRFD Models

Model Name Easy Medium Hard Use Case
scrfd_500m 90.57% 88.12% 68.51% Real-time applications
scrfd_10g 95.16% 93.87% 83.05% High accuracy + speed

Face Recognition Models

ArcFace

  • arcface_mnet: MobileNet backbone - Balanced performance (recommended)
  • arcface_resnet: ResNet50 backbone - Maximum accuracy

Trained on MS1M-V2 dataset (5.8M images, 85K identities)

MobileFace

Model Name Backbone LFW CALFW CPLFW AgeDB-30 Use Case
mobilenetv1_025 MobileNetV1 0.25 98.76% 92.02% 82.37% 90.02% Ultra-lightweight
mobilenetv2 MobileNetV2 99.55% 94.87% 86.89% 95.16% Mobile/Edge
mobilenetv3_small MobileNetV3-S 99.30% 93.77% 85.29% 92.79% Mobile optimized
mobilenetv3_large MobileNetV3-L 99.53% 94.56% 86.79% 95.13% Balanced mobile

Trained on MS1M-V2 dataset (5.8M images, 85K identities)

SphereFace

Model Name Backbone LFW CALFW CPLFW AgeDB-30 Use Case
sphere20 Sphere20 99.67% 95.61% 88.75% 96.58% Research/Comparison
sphere36 Sphere36 99.72% 95.64% 89.92% 96.83% Research/Comparison

Trained on MS1M-V2 dataset (5.8M images, 85K identities)

Facial Analysis Models

Landmark Detection

  • 2d_106: 106-point facial landmark detection

Age & Gender Detection

  • age_gender: Predicts age and gender from face regions

Emotion Recognition

  • affecnet7: 7-class emotion recognition (Neutral, Happy, Sad, Surprise, Fear, Disgust, Anger)
  • affecnet8: 8-class emotion recognition (adds Contempt)

Installation

pip install uniface

For GPU acceleration:

pip install uniface[gpu]

Model Selection Guide

By Use Case

  • Mobile/Edge: RetinaFace MNET_025 + MobileFace MNET_V2
  • Real-time: SCRFD 500M + ArcFace MNET
  • High Accuracy: SCRFD 10G + ArcFace RESNET
  • Server/Cloud: RetinaFace R34 + ArcFace RESNET

By Hardware

  • Apple Silicon: All models work well with ARM64 optimizations
  • NVIDIA GPU: Larger models for maximum throughput
  • CPU Only: Lightweight models recommended

Available Scripts

  • run_detection.py: Face detection with different models
  • run_recognition.py: Face recognition and similarity comparison
  • run_landmarks.py: Facial landmark detection
  • run_age_gender.py: Age and gender prediction
  • run_video_detection.py: Video processing
  • run_face_search.py: Face search system
  • batch_process.py: Batch processing capabilities
  • download_model.py: Model management

Benchmarking

Test performance on your hardware:

python scripts/run_detection.py --iterations 100

Documentation

v1.0.0

09 Nov 11:52

Choose a tag to compare

Full Changelog: v0.1.2...v1.0.0

🎉 UniFace v1.0.0 - First Stable Release

This is the first production-ready release of UniFace with a complete feature set, stable API, and comprehensive documentation.

✨ What's New

High-Level Pipeline API

  • FacePipeline - Comprehensive face analysis workflows
  • process_faces() - Task-based processing (detect, landmarks, recognize, age_gender, emotion)
  • compare_faces() - Compare faces between two images
  • extract_face_embeddings() - Extract embeddings for face recognition
  • analyze_face_attributes() - Analyze age, gender, and emotion

Face Detection

  • RetinaFace detector (MobileNet, ResNet variants)
  • SCRFD detector (10G, 500M variants)
  • Unified detection output format

Face Recognition

  • ArcFace models (MobileNet, ResNet)
  • MobileFace models (lightweight)
  • SphereFace models (angular margin)
  • Normalized embedding extraction

Landmark Detection

  • 106-point facial landmark detection
  • Landmark-based face alignment

Attribute Analysis

  • Age and Gender Detection
  • Emotion Recognition (7 categories)

Documentation & Examples

  • Comprehensive README with quick start
  • examples/README.md with detailed usage guide
  • examples/basic_usage.py - 6 practical examples
  • examples/advanced_usage.py - Advanced patterns (batch processing, video, face database)
  • Jupyter notebooks for tutorials

🚀 Quick Start

import uniface

# Simple face detection
faces = uniface.detect_faces(image, method='retinaface')

# Comprehensive analysis
faces = uniface.process_faces(
    image,
    tasks=['detect', 'landmarks', 'age_gender', 'emotion']
)

# Face comparison
result = uniface.compare_faces(image1, image2, threshold=0.6)

📦 Installation

pip install uniface

🔧 What Changed

  • API Standardization: Unified data formats across all modules
  • Factory Functions: create_detector(), create_recognizer(), create_landmarker(), create_attribute_predictor()
  • Module Organization: Clean separation of detection, recognition, landmark, and attribute modules
  • Documentation: Simplified to maintainable Markdown files
  • Apple Silicon Support: Added onnxruntime-silicon support
  • Improved Logging: Verbose flag for better debugging

🗑️ Removed

  • Legacy RetinaFace implementation (consolidated into detection module)
  • Complex MkDocs documentation setup
  • Duplicate code

🐛 Fixed

  • API format inconsistencies
  • Code duplication issues
  • Import structure and module exports
  • Installation issues with onnxruntime-gpu

📚 Documentation


Full Changelog: https://github.com/yakhyo/uniface/commits/v1.0.0

Full Changelog: v0.1.9...v1.0.0