Run real-time emotion detection on a webcam feed with a single Python command
Process a batch of portrait images to label each face with an emotion and gender prediction
Deploy the classifier as a local web service using Docker and send images to it via HTTP
Retrain the emotion model on a custom dataset using the provided training scripts and fer2013-format data
Requires specific older versions of Keras and TensorFlow, the author has deprecated this repo in favor of the paz rewrite.
This repository contains code for detecting faces in images and video and then classifying the detected faces by emotion and gender in real time. It was built using Keras (a Python library for building neural networks), OpenCV (a library for computer vision tasks like reading camera input), and two publicly available datasets: fer2013 for emotions and IMDB for gender. The emotion model was trained to recognize seven emotional states and achieves about 66% accuracy on its test set. The gender model reaches 96% accuracy. The repository includes demo scripts for running classifications live from a webcam, processing a single image, or visualizing which parts of the face the model pays attention to when making its predictions (a technique called guided backpropagation). You can also run the classifier as a web service using a pre-built Docker image. That setup starts a small server on your machine and accepts image uploads, returning the annotated image with predictions drawn on it. For those who want to train their own versions of these models, the README provides instructions for downloading the required datasets and running the training scripts. The fer2013 dataset is available from a Kaggle competition page, and the IMDB face dataset is hosted by a university research group. Training requires downloading several gigabytes of data. The README notes that this repository is deprecated. The author has moved the project to a newer codebase called paz, which was rewritten to be compatible with TensorFlow 2.0. The original code here still works for the older framework versions it was written for.
← oarriaga on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.