| title | Burn Assessment |
|---|---|
| emoji | 🔥 |
| colorFrom | red |
| colorTo | yellow |
| sdk | gradio |
| sdk_version | 6.14.0 |
| app_file | app.py |
| pinned | false |
Web-deployable AI-powered burn injury assessment.
- 📸 Upload burn photo → AI vision analysis (Gemini)
- 📊 TBSA estimation via Lund-Browder chart (age-adjusted)
- 💧 Parkland fluid resuscitation calculation
- 📚 Clinical explanation via RAG (ChromaDB knowledge base + Gemini)
This is a single-file Gradio app deployed on Hugging Face Spaces.
- Python 3.10 or newer
- Gemini API key (free): https://aistudio.google.com/apikey
git clone <this-repo-url>
cd burn_assessment_web
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtcp .env.example .env
# Edit .env, replace `your_key_here` with your actual Gemini keypython app.pyFirst run downloads the embedding model (~90 MB) and builds the RAG index (~15 sec total).
- Create account at https://huggingface.co (free)
- Get a write-enabled access token: Settings → Access Tokens → New token → Role: Write → save the value
- Create new Space:
- https://huggingface.co/new-space
- Owner: your username
- Space name:
burn-assessment(or any slug) - License: MIT
- SDK: Gradio
- Hardware: CPU basic (free)
- Add the API key as a Secret:
- In the Space → Settings → Variables and secrets → New secret
- Name:
GEMINI_API_KEY - Value: your Gemini API key from aistudio.google.com
The Space provides a Git URL. Add it as a remote and push:
cd burn_assessment_web
# Add the HF Space as a remote (use your username and space name)
git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/burn-assessment
# Push (you'll be prompted for username and the access token from step 2)
git push hf master:mainHF Spaces will install dependencies and start the app (2–5 minutes). When done, the app is live at:
https://YOUR_USERNAME-burn-assessment.hf.space
After making changes:
git add .
git commit -m "your change"
git push hf master:mainThe Space auto-rebuilds on each push.
burn_assessment_web/
├── app.py # Gradio UI + Gemini vision + analyze() orchestrator
├── calculator.py # Lund-Browder chart + Parkland formula (pure logic)
├── rag_engine.py # ChromaDB retrieval + Gemini explanation
├── knowledge_base/ # 7 medical reference .txt files
├── tests/ # pytest unit tests
├── requirements.txt
├── .env.example
└── README.md (this file)
- UI: Gradio 6.x
- AI Vision + Text: Google Gemini API (free tier)
- Vector store: ChromaDB (persistent)
- Embeddings: sentence-transformers/all-MiniLM-L6-v2
- Hosting: Hugging Face Spaces (free CPU)
This tool is a clinical aid, not a substitute for professional medical judgment.
- AI TBSA estimates are approximations and must be clinically verified.
- Always confirm with a physical Lund-Browder chart.
- Parkland formula gives an initial estimate — adjust based on actual urine output.
- Final clinical decisions belong to the responsible clinician.
source venv/bin/activate
pytest tests/ -vSmoke tests that hit Gemini are skipped automatically if GEMINI_API_KEY is unset or still the placeholder.