Demo app: PHQ-9 questionnaire + optional face detection + Gemini-generated motivational/referral cards.
- app.py : Streamlit app (questionnaire + camera + Gemini)
- PHQ9.csv : questions (must have 'question' column)
- frontal.xml / eye.xml : optional Haar cascades (if missing, fallback to OpenCV builtins)
- .streamlit/secrets.toml : optional secrets file (DO NOT COMMIT)
- Clone/copy project folder.
- Create virtualenv (recommended):
python -m venv .venv- Activate:
- mac/linux:
source .venv/bin/activate - windows:
.venv\Scripts\activate
- mac/linux:
- Install dependencies:
pip install -r requirements.txt
- Set your Google API key (do NOT hardcode in files):
- mac/linux:
export GOOGLE_API_KEY="AIza..."
- Windows PowerShell:
setx GOOGLE_API_KEY "AIza..."
- Or create
.streamlit/secrets.tomlwithGOOGLE_API_KEY = "..."(do not commit)
- mac/linux:
- Run app:
streamlit run app.py
- Open the URL printed in terminal (usually http://localhost:8501).
Option A (quick & temporary):
- In notebook cell:
import os os.environ["GOOGLE_API_KEY"] = "YOUR_GOOGLE_API_KEY"