--- title: Real-Time Emotion Detection emoji: 😊 colorFrom: green colorTo: blue sdk: gradio sdk_version: 6.5.1 app_file: app.py pinned: false license: mit --- # 😊 Real-Time Emotion Detection A deep learning app that detects human facial emotions from images using a **CNN trained with Keras/TensorFlow**, deployed via **Gradio** on Hugging Face Spaces. ## How to Use 1. Upload a photo **or** click the webcam icon to capture a live photo 2. The model will detect faces in the image 3. Each detected face will be labeled with the predicted emotion and confidence score ## Detectable Emotions | Emotion | Label | |------------|-------| | 😠 Angry | 0 | | 😄 Happy | 1 | | 😐 Neutral | 2 | | 😢 Sad | 3 | | 😲 Surprised | 4 | ## Model Details - **Architecture:** Custom CNN (3 Conv layers + Dense) - **Input:** 48×48 grayscale face image - **Output:** Softmax probabilities over 5 emotion classes - **Face Detection:** OpenCV Haar Cascade (`haarcascade_frontalface_default.xml`) ## Tech Stack - TensorFlow / Keras - OpenCV - Gradio - NumPy