Spaces:
Sleeping
Sleeping
File size: 1,310 Bytes
04a5678 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# Car Damage Inspector (Hugging Face-ready)
An open-source, one-file Gradio app that:
1) Classifies car damage type with a transformer classifier.
2) Detects damage regions & severity (Light/Moderate/Severe) with YOLOv8.
**Models used**
- `beingamit99/car_damage_detection` (image classification)
- `nezahatkorkmaz/car-damage-level-detection-yolov8` (YOLOv8 detector)
## Quickstart (local)
```bash
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python app.py
```
Open the Gradio link shown in the terminal and upload a car photo.
## Deploy to Hugging Face Spaces
1. Create a new **Space** (Python).
2. Upload these three files:
- `app.py`
- `requirements.txt`
- `README.md`
3. The Space will auto-build, download models on first run, and serve the UI.
## Notes
- First inference will download model weights; allow a little time.
- Gate logic is heuristic: if the top classification score < 0.5 (or model predicts an explicit *no-damage* class), the app returns "No visible damage".
- Replace/extend with your own gate (e.g., a dedicated binary model) if desired.
- Outputs:
- **JSON** with top-3 labels and YOLO detections,
- **Overlay image** with bounding boxes,
- **Raw YOLO JSON** (for debugging/integration).
|