CoolFace
Apppublic

edyfy/Depression-Detection-Voice

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

Depression Detection (Voice)

This Space uses a voice input to detect signs of depression using a trained ML model.

๐ŸŽ™๏ธ Depression Detection from Voice

This project is uses machine learning to predict the risk of depression from short audio samples of speech. โš ๏ธ Disclaimer: This tool is for educational purposes only and not for clinical or medical use.


๐Ÿ“Œ Features

  • โ€”Upload or record voice samples directly in the app.
  • โ€”Extracts audio features (e.g., MFCCs) using librosa.
  • โ€”Predicts probability of depression (0 = low, 1 = high) using a trained model.
  • โ€”Interactive Gradio UI for testing and demonstration.

๐Ÿ› ๏ธ Installation

1. Clone the repository

bash
git clone https://github.com/your-username/dep_voice_scaffold.git
cd dep_voice_scaffold

2. Set up environment

Install dependencies with pip:

bash
pip install -r requirements.txt

Or if you prefer conda:

bash
conda create -n depvoice python=3.10
conda activate depvoice
pip install -r requirements.txt

โ–ถ๏ธ Running the App

Run the Gradio app:

bash
python app.py

This will launch a local web interface (usually at http://127.0.0.1:7860/).


๐Ÿ“‚ Project Structure

dep_voice_scaffold/
โ”‚โ”€โ”€ app.py               # Main Gradio app
โ”‚โ”€โ”€ requirements.txt      # Dependencies
โ”‚โ”€โ”€ configs/
โ”‚    โ””โ”€โ”€ default.yaml     # Feature extraction & model config
โ”‚โ”€โ”€ artifacts/
โ”‚    โ”œโ”€โ”€ model.pkl        # Trained model
โ”‚    โ””โ”€โ”€ metrics.yaml     # Evaluation metrics (with threshold)
โ”‚โ”€โ”€ src/
โ”‚    โ””โ”€โ”€ depvoice/        # Feature extraction code

๐Ÿ“Š Example Output

After uploading a voice file, the app will return:

  • โ€”Probability scores (Depressed vs Not Depressed)
  • โ€”Final prediction (based on threshold in metrics.yaml)

โš ๏ธ Disclaimer

This project is for academic purposes only. It is not a diagnostic tool and must not be used in clinical settings.


โœจ Made with Python, Gradio, and โค๏ธ for research.