๐ Real-Time Emotion Detection using CNN
This project detects human emotions (like Happy, Sad, Angry, etc.) in real-time using your webcam, powered by Convolutional Neural Networks (CNN) and OpenCV.
๐ Project Structure
๐ง Emotion Classes Detected
Angry
Disgust
Fear
Happy
Sad
Surprise
Neutral
๐ฆ Step-by-Step Setup Instructions
โ
1. Prerequisites
Python 3.7 or higher
Webcam (built-in or external)
๐ 2. Clone the Repository
๐งช 3. Create a Virtual Environment (Optional but Recommended)
๐ 4. Install Required Libraries
๐ฏ 5. Run the Application
Make sure the files
emotion_model.h5 and haarcascade_frontalface.xml are in the same directory as your Python script.This will activate your webcam and start detecting emotions in real time.
๐ง Libraries Used
Keras โ For loading the pre-trained CNN modelTensorFlow โ Backend for KerasOpenCV โ For webcam access and face detectionNumPy โ For image array manipulationโ๏ธ How It Works
The webcam feed is captured using
cv2.VideoCapture().Faces are detected in each frame using Haar Cascades.
The face region is preprocessed and passed through a CNN model.
The model outputs an emotion class which is displayed on the screen.
๐ผ๏ธ Sample Output
Emotion label is overlaid on the detected face in real-time video feed.
๐ Contact
For questions, suggestions, or collaboration:
0 likes ยท 5 views ยท May 29, 2025
Developed a real-time emotion detection system using CNN and OpenCV.