Skip to content

greatakela/emorec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emotion Recognition Web Application

This project combines a Flask web application with real-time emotion detection capabilities using computer vision and machine learning. The application can detect emotions from webcam feed and visualize them in real-time.

Features

  • Real-time emotion detection from webcam feed
  • Live emotion visualization with bar charts
  • Video recording with emotion annotations
  • GIF generation of emotion charts
  • Cumulative emotion statistics tracking
  • Web interface for easy access

Project Structure

├── app.py              # Flask web application
├── emopy.py           # Emotion detection and visualization script
├── requirements.txt   # Python dependencies
├── static/           # Static files
│   └── favicon.ico   # Website favicon
└── artefacts/        # Generated output files

Prerequisites

  • Python 3.8 or higher
  • Webcam
  • Virtual environment (recommended)

Installation

  1. Clone the repository:
git clone <repository-url>
cd <repository-name>
  1. Create and activate a virtual environment:
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On Unix or MacOS
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

Running the Web Application

Start the Flask web server:

python app.py

The application will be available at http://localhost:5000

Running Emotion Detection

Run the emotion detection script:

python emopy.py

The script will:

  • Open your webcam
  • Detect emotions in real-time
  • Display a live bar chart of emotions
  • Save the video feed with emotion annotations
  • Generate a GIF of the emotion chart
  • Create a cumulative emotion statistics chart

Press 'q' to quit the emotion detection program.

Output Files

The program generates several output files:

  • emotion_video.avi: Video recording with emotion annotations
  • emotion_chart.gif: Animated chart of emotion changes
  • cumulative_emotions.jpg: Static chart showing emotion trends over time

Dependencies

  • Flask: Web framework
  • FER: Face Emotion Recognition
  • OpenCV: Computer vision library
  • Matplotlib: Data visualization
  • NumPy: Numerical computing
  • Pandas: Data manipulation
  • ImageIO: Image processing

For a complete list of dependencies, see requirements.txt.

Contributing

Feel free to submit issues and enhancement requests!

License

About

Emotion recognition

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages