Skip to content

High-performance Facial Recognition API in Go A lightweight, production-ready facial recognition service that provides fast and accurate face matching capabilities through a RESTful API

License

Notifications You must be signed in to change notification settings

npub1337/facemate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Recognition Processor

A Go-based facial recognition system with REST API endpoints for training and comparing faces.

Features

  • Face training with unique identifiers
  • Face comparison with similarity scores
  • RESTful API endpoints
  • Base64 image support
  • Local storage of face embeddings
  • Docker support

Requirements

  • Docker and Docker Compose
  • Go 1.21+ (for local development)

Quick Start

  1. Clone the repository
  2. Create a models directory and download the required face recognition models
  3. Run with Docker Compose:
docker-compose up --build

The API will be available at http://localhost:8080

API Endpoints

Train Face

POST /train
Content-Type: application/json

{
    "image": "base64_encoded_image",
    "person_id": "unique_identifier"
}

Compare Face

POST /compare
Content-Type: application/json

{
    "image": "base64_encoded_image"
}

Response:

{
    "person_id": "matched_identifier",
    "similarity": 0.95
}

Development

  1. Install dependencies:
go mod download
  1. Run locally:
go run cmd/api/main.go

Project Structure

.
├── cmd/
│   └── api/
│       └── main.go
├── internal/
│   ├── api/
│   │   └── handler.go
│   ├── face/
│   │   └── service.go
│   └── storage/
│       └── service.go
├── models/           # Face recognition models
├── data/            # Stored face embeddings
├── Dockerfile
├── docker-compose.yml
└── README.md

Configuration

The application uses the following default configuration:

  • Server port: 8080
  • Face similarity threshold: 0.6
  • Storage location: ./data/faces.json

License

MIT License

About

High-performance Facial Recognition API in Go A lightweight, production-ready facial recognition service that provides fast and accurate face matching capabilities through a RESTful API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published