acc_api / README.md
Adit1Sharma's picture
Initial commit: FastAPI Incident Analyzer for HF Spaces
8e6f164
|
Raw
History Blame Contribute Delete
1.08 kB
---
title: Emergency Incident Detection API
emoji: 🚨
colorFrom: red
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
---
# Emergency Incident Detection & Severity Analyzer API
A REST API wrapper around Hugging Face's `grounding-dino-base` zero-shot object detection model for analyzing emergency incidents, blockages, and hazards.
## API Endpoints
### 1. Root Endpoint
- **GET** `/`
- Returns a welcome message.
### 2. Health Check
- **GET** `/health`
- Returns the service health status and confirms whether the model has loaded successfully.
### 3. Analyze Image
- **POST** `/api/v1/incidents/analyze`
- Upload an image file under key `file`.
- **Response Schema**:
```json
{
"success": true,
"incident_type": "road_accident",
"severity": "high",
"severity_score": 78,
"keywords": [
"car",
"truck",
"ambulance",
"person"
],
"counts": {
"car": 2,
"truck": 1,
"ambulance": 1,
"person": 4
},
"detections": [
{
"label": "car",
"confidence": 0.91,
"box": [10.2, 50.4, 250.7, 400.1]
}
]
}
```