An open API service indexing awesome lists of open source software.

https://github.com/dev6699/face

A collection of Face AI models
https://github.com/dev6699/face

face-detection face-recognition triton-inference-server

Last synced: about 2 months ago
JSON representation

A collection of Face AI models

Awesome Lists containing this project

README

          

# face

[![GoDoc](https://pkg.go.dev/badge/github.com/dev6699/face)](https://pkg.go.dev/github.com/dev6699/face)
[![Go Report Card](https://goreportcard.com/badge/github.com/dev6699/face)](https://goreportcard.com/report/github.com/dev6699/face)
[![License](https://img.shields.io/github/license/dev6699/face)](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](#introduction)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Available Models](#available-models)
- [Pre and Post Processing](#pre-and-post-processing)
- [Disclaimer](#disclaimer)
- [License](#license)

## 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:

```bash
go get github.com/dev6699/face
```

- ### Clone the Repository:

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

### Download and Prepare Models:
- Navigate to the [Available Models](#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:

```bash
mkdir -p model_repository/yoloface/1
wget -O model_repository/yoloface/1/model.onnx
```
Ensure to replace with the actual URL provided in the [Available Models](#available-models) section.

## Usage
Please refer to the [examples](examples) folder for more information on how to use the models and run various tasks.

1. Start Triton Inference Server:

```bash
docker-compose up tritonserver
```

## Available Models
### 2DFAN4 for Landmark 68 Detection
- Model Name: [2dfan4](model/2dfan4/2dfan4.go)
- Description: Detects 68 facial landmarks for detailed facial analysis and alignment.
- Download Link: [Download 2DFAN4 Model](https://github.com/facefusion/facefusion-assets/releases/download/models/2dfan4.onnx)

### ArcFace for Feature Embedding
- Model Name: [arcface_w600k_r50](model/arcface/arcface.go)
- Description: Generates feature embeddings for faces, useful for identity verification and facial recognition tasks.
- Download Link: [Download ArcFace Model](https://github.com/facefusion/facefusion-assets/releases/download/models/arcface_w600k_r50.onnx)

*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](model/gfpgan/gfpgan.go)
- Description: Enhances facial features and improves image quality, often used for face restoration and super-resolution tasks.
- Download Link: [Download GFPGAN Model](https://github.com/facefusion/facefusion-assets/releases/download/models/gfpgan_1.4.onnx)

| Input | Output |
| :---: | :----: |
| | |

### Face Occluder Detection
- Model Name: [face_occluder](model/faceoccluder/faceoccluder.go)
- Description: Detects parts of a face that are not occluded by objects, providing insights into visible facial features.
- Download Link: [Download Face Occluder Model](https://github.com/facefusion/facefusion-assets/releases/download/models/face_occluder.onnx)


### Gender and Age Estimation
- Model Name: [gender_age](model/genderage/genderage.go)
- Description: Detects gender and estimates the age of detected faces.
- Download Link: [Download Gender and Age Estimation Model](https://github.com/facefusion/facefusion-assets/releases/download/models/yoloface_8n.onnx)

### Inswapper
- Model Name: [inswapper_128_fp16](model/inswapper/inswapper.go)
- Description: Swaps the target face with a source face, enabling realistic face replacement in images.
- Download Link: [Download Inswapper Model](https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128_fp16.onnx)

| Source | Target | Output |
| :----: | :----: | :----: |
| | | |

### YOLOFace
- Model Name: [yoloface](model/yoloface/yoloface.go)
- Description: Detects face bounding boxes and the 5 key facial landmarks (landmark5) using the YOLO architecture.
- Download Link: [Download YOLOFace Model](https://github.com/facefusion/facefusion-assets/releases/download/models/yoloface_8n.onnx)

## 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](LICENSE) file for details.