Downloads ยท 30 days
0
BiernyVR/car-damage-classifier
car-damage-classifier is a image classification model from BiernyVR. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
A production-grade EfficientNetV2-M computer vision model fine-tuned for automated vehicle damage classification and repair cost range estimation for automotive insurance claim pipelines.
Downloads ยท 30 days
0
Access
Public
Updated Sep 14, 2026
Repo size
426 MB
Likes
0
Public
Click a slice to open those files.
.pth213 MB ยท 50%
From the Hugging Face model README
A production-grade EfficientNetV2-M computer vision model fine-tuned for automated vehicle damage classification and repair cost range estimation for automotive insurance claim pipelines.
Identifies 7 damage severity categories and maps each prediction to estimated repair costs in Polish Zลoty (PLN).
efficientnet_v2_m_best.pth โ PyTorch weights.efficientnet_v2_m_damage.onnx + .onnx.data โ High-performance ONNX model for TensorRT / C++ / Edge inference.damage_metadata.json โ Class names and corresponding repair cost intervals.| Class | Damage Type | Severity | Estimated Repair Cost (PLN) |
|---|---|---|---|
glass_damage | Cracked / shattered windshield or side window | Minor | 300 โ 3 000 PLN |
tire_damage | Puncture / flat / sidewall rupture | Minor | 400 โ 2 500 PLN |
minor_dent | Surface dent / minor bumper scratch | Low | 500 โ 2 000 PLN |
moderate_damage | Deformed panels, door dent, bumper crack | Medium | 2 000 โ 10 000 PLN |
severe_damage | Heavy collision, crumpled hood, suspension impact | High | 10 000 โ 30 000 PLN |
flood_damage | Waterline immersion, electronics & interior water ingress | Critical | 15 000 โ 50 000 PLN |
total_loss | Frame / structural destruction, catastrophic accident | Total | > 50 000 PLN |
pip install onnxruntime pillow numpy huggingface_hub
import json
import numpy as np
from PIL import Image
import onnxruntime as ort
from huggingface_hub import hf_hub_download
# 1. Download model & metadata
model_path = hf_hub_download(repo_id="BiernyVR/car-damage-classifier", filename="efficientnet_v2_m_damage.onnx")
data_path = hf_hub_download(repo_id="BiernyVR/car-damage-classifier", filename="efficientnet_v2_m_damage.onnx.data")
meta_path = hf_hub_download(repo_id="BiernyVR/car-damage-classifier", filename="damage_metadata.json")
with open(meta_path, "r", encoding="utf-8") as f:
meta = json.load(f)
classes = meta["classes"]
cost_ranges = meta["cost_ranges_pln"]
# 2. Preprocess image
img = Image.open("damaged_car.jpg").convert("RGB").resize((224, 224), Image.Resampling.BILINEAR)
arr = (np.array(img, dtype=np.float32) / 255.0 - [0.485, 0.456, 0.406]) / [0.229, 0.224, 0.225]
tensor = np.expand_dims(np.transpose(arr, (2, 0, 1)), axis=0).astype(np.float32)
# 3. Run Inference
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
logits = session.run(None, {"input": tensor})[0][0]
probs = np.exp(logits - np.max(logits))
probs /= probs.sum()
pred_idx = np.argmax(probs)
pred_class = classes[pred_idx]
cost = cost_ranges[pred_class]
print(f"Diagnosis: {pred_class} ({probs[pred_idx]*100:.1f}%)")
print(f"Estimated Cost: {cost[0]} - {cost[1]} PLN")
python infer.py --image sample_dent.jpg --topk 3
efficientnet_v2_m_best.pth: PyTorch weights checkpoint.efficientnet_v2_m_damage.onnx + .onnx.data: Exported ONNX model.damage_metadata.json: Classes and PLN cost boundaries.confusion_matrix.png, business_cost_matrix.png, per_class_metrics.png, training_curves.png: Evaluation and training plots.sample_dent.jpg, sample_severe.jpg: Example test images.infer.py: Standalone CLI testing script.