๐ก API Endpoint
POST /predict_pneumonia
Description: Analyze respiratory audio file for pneumonia risk assessment
Content-Type: multipart/form-data
Parameter: audio_file - Audio file (.wav, .mp3, etc.)
๐ฅ Response Format
{
"filename": "recording.wav",
"pneumonia_risk_score": 0.7234,
"risk_level": "High",
"note": "This is an AI assessment, not a medical diagnosis..."
}
Risk Levels:
- Low: Risk score < 0.4
- Moderate: Risk score 0.4 - 0.7
- High: Risk score > 0.7
๐ป Usage Example
Using cURL:
curl -X POST \\ -F "audio_file=@recording.wav" \\ https://root16285-pneumonia-space.hf.space/predict_pneumonia
Using Python:
import requests
url = "https://root16285-pneumonia-space.hf.space/predict_pneumonia"
files = {"audio_file": open("recording.wav", "rb")}
response = requests.post(url, files=files)
print(response.json())
๐งช Test the API
Upload an audio file to test the pneumonia risk assessment: