Skip to content

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.

Notifications You must be signed in to change notification settings

aritrikg/Human-Mental-Health-Condition-Detection

Repository files navigation

🧠 Human Mental Health Condition Detection

Python Streamlit License: MIT Deploy on Streamlit

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.


📸 Features

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

🚀 Demo

App Screenshot 🌐 Try Now: https://share.streamlit.io/ 📦 Download the dataset used: FER2013


💻 Tech Stack

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

🗂️ Folder Structure

├── 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 file

⚙️ Setup Instructions

1. Clone the Repository

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

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Add Model & Cascade Files

  • Place model.h5 (trained Keras model) in the root directory.

  • Place haarcascade_frontalface_default.xml in the root directory.

5. Run the App

streamlit run emotion.py

🌍 Deployment Options

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

🟡 Hugging Face Spaces (Optional)

  • Create a new Gradio or Streamlit Space
  • Upload files and paste your emotion.py

🪪 License

This project is licensed under the MIT License.
See the LICENSE file for details.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors