Skip to content

ger0nymo/face-authentication-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask API for a face recognition based authentication system

Introduction

I created this as part of a college project laboratory project. The project is a face recognition based authentication system.

This API is capable creating embedding vectors of faces and also comparing an image with an embedding vector.

The app utilizes Flask and the facenet-pytorch library to create rest endpoints that can create the embedding vectors and do the comparisons.

Installation

  1. Clone the repository
  2. Install the requirements
pip install -r requirements.txt
  1. Run the app
flask --debug run

Example requests

Every request should contain an api key in the headers.

The API key is known only to the authentication backend API and this API.

Create an embedding vector

POST /image-embedding

Payload type: form-data

interface Payload {
    image: File,
}

Expected successful result: Status code - 200

{
  "fv": [...] 
}

It should return a 512 dimensional embedding vector.

Compare an image with an embedding vector

POST /compare-faces

Payload type: form-data

interface Payload {
    image: File,
    fv: string, // The embedding vector as a string in { "fv": [...] } format
}

Expected successful result: Status code - 200

{
  "cosine_similarity": 0.9
}

It should return the cosine similarity between the embedding vector taken off the image and the image and the embedding vector parameter.

About

Simple face authentication service API written in Flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages