Views
No views yet
pulmo-backend/
│── main.py # FastAPI server (API routes)
│── model_inference.py # Model loading, preprocessing, Grad-CAM
│── requirements.txt # Dependencies
│── .env.example # API keys & config
│── swin_best_model.pth # Model checkpoint1git clone https://github.com/joshchan1301/pulmo-backend.git
2cd pulmo-backendpip install -r requirements.txt.env file:OPENAI_API_KEY=sk-xxxxxxxhttps://drive.google.com/uc?export=download&id=1VD2pXT9aDHmGwn2KiD3aSoXj5nBglVLwuvicorn main:app --reloadPOST /api/analyze-xrayfile (form-data, image .png/.jpg)1{
2 "label": "BACTERIAL",
3 "probability": 87.5,
4 "heatmap": "<base64-encoded PNG>"
5}POST /api/chat{ "message": "What does my X-ray mean?" }1{
2 "reply": "The X-ray indicates signs of bacterial pneumonia. The red highlighted areas are where the model focused most."
3}