Skip to content

jaimeteb/facial-recognition-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Facial Recognition System

This is a simple facial recognition system using Python, PostgreSQL and JavaScript, running on Docker Compose.

Disclaimer ⚠️

This project was originally developed as part of a surveillance system in the retail industry in Mexico. Most of the content is in Spanish and has retail-related elements.

Features

The system is capable of:

  • Registering new faces in the database
  • Deleting faces from the database
  • Extracting age, gender and emotion from the faces

When a face is added, the images provided are used to perform data augmentation, in order to keep a minimum of 10 embeddings per entry.

Two different classifiers can be used:

  • Support Vector Classifier
  • Ball Tree Nearest-Neighbor

The model is trained upon addition and/or deletion of an entry.

Requirements

  • Docker & Docker Compose

Installation

  1. Clone the project and cd into it.
  2. Create a file called .env with the following content:
PG_USER=example_user
PG_PASS=example_password
PG_DB=example_database
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
APP_PORT=8000
  1. Start the project with docker-compose up

Register

In order to register new faces, run the project and go to localhost:8000/agregar.

Register 1

You can add multiple images from your computer and provide additional information about the subject.

Click on "Agregar" in order to get a visualization of the facial landmarks of the images provided. You can then discard the images that could not be useful or the ones that have misplaced landmarks.

Register 2

Then click on "Confirmar" to add the new faces to the database.

Delete

In order to delete faces, go to localhost:8000/eliminar.

You will be prompted with the entries that you had previously registered, as well as their details. Click on the buttons under "Eliminar" to delete them.

Delete

Predict

To perform a prediction on a new image, go to localhost:8000/predecir.

Upload an image from your computer and click on "Predecir". The results of the prediction (name, similarity, age, gender and emotion) will be shown on the right.

Predict

References

Component Reference
Face embedding extraction Keras-OpenFace
Data augmentation Imgaug
Emotion estimation Emotion-detection
Age and gender prediction Age-Gender-Predictor

TODO

  • Check for previous instances of a new face
  • Improve frontend
  • Translate everything to english
  • Write API specification