Skip to content

dev6699/face

Repository files navigation

face

GoDoc Go Report Card License

A comprehensive collection of face AI models with integrated pre and post-processing steps, utilizing NVIDIA Triton Inference Server for seamless inference. This repository aims to provide easy-to-use face detection, recognition, and analysis tools.

Table of Contents

Introduction

This repository contains a suite of face AI models designed for various applications, such as face detection, recognition, and analysis. The models are optimized for performance and ease of use, leveraging NVIDIA Triton Inference Server for scalable and efficient inference.

Features

  • Diverse Collection of Models: Includes models for face detection, recognition, age estimation, feature embedding, and landmark detection.
  • Integrated Pre and Post-Processing: Ensures consistent and accurate results across different models.
  • Triton Inference Server Integration: Facilitates efficient and scalable model deployment.
  • Easy-to-Use Interface: Simple API for quick integration into various applications.

Installation

  • Use go get to install this package:

    go get github.com/dev6699/face
  • Clone the Repository:

    git clone https://github.com/dev6699/face.git
    cd face

Download and Prepare Models:

  • Navigate to the Available Models section to find the download links for each model.

  • Download each model and rename the file to model.onnx.

  • Place each model.onnx file into its respective directory within the model_repository folder.

  • Example: Setting up the YOLOFace model:

    mkdir -p model_repository/yoloface/1
    wget -O model_repository/yoloface/1/model.onnx <model_url>

    Ensure to replace <model_url> with the actual URL provided in the Available Models section.

Usage

Please refer to the examples folder for more information on how to use the models and run various tasks.

  1. Start Triton Inference Server:

    docker-compose up tritonserver

Available Models

2DFAN4 for Landmark 68 Detection

  • Model Name: 2dfan4

  • Description: Detects 68 facial landmarks for detailed facial analysis and alignment.

  • Download Link: Download 2DFAN4 Model

ArcFace for Feature Embedding

  • Model Name: arcface_w600k_r50

  • Description: Generates feature embeddings for faces, useful for identity verification and facial recognition tasks.

  • Download Link: Download ArcFace Model

    Cosine distance of arcface embedding

    Source\Target
    0.00 0.29 0.48
    0.29 0.00 0.45
    0.48 0.45 0.00

Face Enhancer with GFPGAN

  • Model Name: gfpgan_1.4

  • Description: Enhances facial features and improves image quality, often used for face restoration and super-resolution tasks.

  • Download Link: Download GFPGAN Model

    Input Output

Face Occluder Detection

Gender and Age Estimation

Inswapper

YOLOFace

  • Model Name: yoloface

  • Description: Detects face bounding boxes and the 5 key facial landmarks (landmark5) using the YOLO architecture.

  • Download Link: Download YOLOFace Model

Pre and Post Processing

Pre-processing

Each model has specific pre-processing steps to ensure accurate results. Common steps include:

  • Resizing: Scaling the input image to the required dimensions.
  • Normalization: Adjusting pixel values to a standard range.
  • Face Alignment: Aligning faces for consistent feature extraction.

Post-processing

Post-processing varies by model and typically includes:

  • Bounding Box Extraction: Extracting face locations from detection models.
  • Feature Extraction: Computing facial features for recognition models.
  • Label Assignment: Assigning predicted labels or scores.

Disclaimer

Model assets are subject to their individual licenses. Ensure that you review and comply with the specific license terms for each model you use. The repository does not grant rights to use third-party models beyond the scope defined in their respective licenses.

License

This project is licensed under the MIT License - see the LICENSE file for details.