Skip to content

aayushi892/emotion_detect

Repository files navigation

😊 Emotion Detection Using OpenCV and Deep Learning

📖 Overview

This application harnesses the power of computer vision and deep learning to identify human emotions from images. By utilizing OpenCV for image processing and frameworks like PyTorch and TensorFlow for model training, this tool offers an intuitive interface for users to classify emotions from facial expressions accurately.

🎯 Objectives

  • Data Collection: Use a diverse dataset containing images of faces labeled with corresponding emotions.
  • Data Preprocessing: Process images using OpenCV to ensure they are suitable for model input.
  • Model Development: Implement and compare multiple deep learning models:
    • Convolutional Neural Networks (CNNs) using PyTorch
    • Pre-trained models with TensorFlow (e.g., VGG16, ResNet)
  • User Interface: Develop a Python UI for users to upload images and receive emotion predictions.

📊 Dataset

The dataset used for this project contains a variety of facial expressions, including:

Emotion Description
Anger Expressing anger or frustration
Disgust Showing disgust or disdain
Fear Exhibiting fear or anxiety
Happy Displaying happiness or joy
Sad Reflecting sadness or disappointment
Surprise Showing surprise or shock

🛠️ Installation

To set up the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/yourusername/emotion-detection.git
    cd emotion-detection
  2. Install the required packages:

    pip install -r requirements.txt

🚀 Usage

Training the Models

To train the emotion detection models, run:

python train_model.py

Running the Python UI

To launch the interactive application, execute:

python app.py

📈 Results

The results of the emotion detection models are evaluated and presented in the results/ directory. Key outputs include:

  • Model Accuracy:

    • CNN (PyTorch): 92%
    • Pre-trained Model (TensorFlow): 95%
  • Confusion Matrix: Visualize the performance of the models.

  • Sample Predictions: View some examples of emotion predictions made by the model.

🔮 Future Work

Future enhancements may include:

  • Integrating real-time emotion detection using webcam input.
  • Expanding the dataset with more diverse images for improved accuracy.
  • Enhancing the UI with more features such as emotion tracking over time.

🙏 Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published