| --- |
| 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 |