A real-time facial emotion detection app using deep learning. This project can be a prototype for detecting mental health conditions based on facial expressions.
- ✅ Upload an image and detect emotional expressions
- ✅ Recognize seven key emotions: Angry, Disgust, Fear, Happy, Sad, Surprise, Neutral
- ✅ Save output images with bounding boxes and labels
- ✅ Clean UI using modern Streamlit design
- ✅ Uses Haar cascade for fast face detection
- ✅ Lightweight and responsive
🌐 Try Now: https://share.streamlit.io/
📦 Download the dataset used: FER2013
| Technology | Use Case |
|---|---|
| Python | Core programming language |
| Streamlit | UI rendering and deployment |
| OpenCV | Face detection |
| Keras/TensorFlow | Emotion classification model |
| Pillow | Image processing and saving |
├── model.h5 # Trained deep learning model
├── haarcascade_frontalface_default.xml# Haar cascade classifier
├── emotion.py # Main Streamlit app
├── requirements.txt # List of dependencies
└── README.md # This filegit clone [https://github.com/your-username/human-mental-health-detection.git](https://github.com/GHOSH2341/Human-Mental-Health-Condition-Detection.git)
cd human-mental-health-detectionpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txt
-
Place model.h5 (trained Keras model) in the root directory.
-
Place haarcascade_frontalface_default.xml in the root directory.
streamlit run emotion.py
- 🟢 Streamlit Cloud
- Push code to a public GitHub repository
- Log in to Streamlit Cloud
- Deploy the app from your repository
- Add model and XML files as static assets or use environment variables/secrets
- Create a new Gradio or Streamlit Space
- Upload files and paste your emotion.py
This project is licensed under the MIT License.
See the LICENSE file for details.