Skip to content

A python program that detects faces in images/webcam live feed through haarcascade and recognizes emotion using Convolutional Neural Network.

License

Notifications You must be signed in to change notification settings

logisticAKB/EmotionRecognition

Repository files navigation

sample

EmotionRecognition - Show your expression (syrex)

This is a Python program that detects faces in images/webcam live feed through haarcascade and recognizes emotion using Convolutional Neural Network.

Installation

  • Install required libraries via pip
    pip install -r requirements.txt
  • Download syrex.weights file and put it into EmotionRecognition/weights/ folder

Usage

# emotion recognition on images
python3 detect.py \
  --image=data/test.jpg \
  --labels=data/data.labels \
  --model=cfg/syrex.json \
  --weights=weights/syrex.weights 
  
# emotion recognition on live feed from webcam
python3 detect_realtime.py \
  --labels=data/data.labels \
  --model=cfg/syrex.json \
  --weights=weights/syrex.weights

Training on your data

  1. Prepare your data
    • Put your images to the EmotionRecognition/data/train/images/ folder
    • Put your labels to the EmotionRecognition/data/train/labels/ folder

       Note: filenames of images must match labels filenames

  1. In order to create csv file needed for training run:
    # from EmotionRecognition/scripts/
    python3 image2pixels.py \
      --image_folder=data/train/images \
      --label_folder=data/train/labels \
      --output=data/train.csv \
      --labels_decode=data/data.labels
  2. Set train parameters in EmotionRecognition/cfg/train.cfg file
  3. Run training:
    python3 train.py \
      --data=data/train.csv \
      --weights_folder=weights/

License

License: MIT

About

A python program that detects faces in images/webcam live feed through haarcascade and recognizes emotion using Convolutional Neural Network.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages