Skip to content

ADiTyaRaj8969/FaceEmotionDetection_Using_Python

Repository files navigation

😊 Real-Time Facial Emotion Detection

This project performs real-time emotion detection using a Convolutional Neural Network (CNN) model and OpenCV. It detects human facial expressions like Happy, Sad, Angry, and more from webcam video input 🎥 and displays a live stats overlay including FPS and detected emotions.


🧠 Features

  • 🎯 Accurate emotion classification using deep learning
  • 📦 Real-time face detection with OpenCV
  • ⚡ Displays FPS and number of faces detected
  • 📊 Live emotion stats with color-coded labels
  • 🎨 Clean and dynamic on-screen overlay

🔍 Detected Emotions

  • 😠 Angry
  • 🤢 Disgust
  • 😨 Fear
  • 😀 Happy
  • 😢 Sad
  • 😲 Surprise
  • 😐 Neutral

📁 Dataset

To train your own model or explore the data, download the full dataset from Kaggle:

🔗 Face Expression Recognition Dataset on Kaggle


🛠️ Setup Instructions

  1. Clone the repository

    git clone https://github.com/your-username/your-repo-name.git
    cd your-repo-name
  2. Install dependencies

    pip install -r requirements.txt
  3. Download or place the pre-trained model

    • Make sure you have emotion.h5 (trained on FER dataset)
    • Place it in the project root directory
  4. Run the emotion detection

    python detect_emotion.py

🧪 Technologies Used

  • 🧠 TensorFlow / Keras – for CNN model
  • 🎥 OpenCV – for webcam capture and face detection
  • 📊 NumPy – for numerical processing
  • 💾 Haar Cascades – for real-time face detection
  • 🐍 Python – programming language used

📦 Folder Structure

├── detect_emotion.py       # Main detection script
├── emotion.h5              # Trained CNN model
├── requirements.txt        # Python dependencies
├── README.md               # Project documentation
└── demo.gif                # Sample output (replace with your own)

🙌 Credits

  • Dataset from Kaggle FER Dataset
  • CNN Model built with Keras
  • Face detection using OpenCV Haar Cascades
  • Developed with ❤️ by Aditya Raj

🔗 Connect with Me


About

This project uses a CNN model with OpenCV to recognize human emotions in real time through a webcam, showing live stats like FPS and face count.

Resources

Stars

17 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors