Downloads · 30 days
76
59% of all-time downloads
Naiscorp/car-damage-detection
car-damage-detection is a image segmentation model from Naiscorp. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for cardamage. The card lists the license as other.
Instance segmentation of 7 types of physical damage on cars, for insurance, rental and resale inspection workflows. Given a photo, the model outputs a pixel mask, a bounding box, a damage class and a confidence score…
Downloads · 30 days
76
59% of all-time downloads
All-time downloads
128
Public
Parameters
191M
2.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.pth765 MB · 33%
From the Hugging Face model README
Instance segmentation of 7 types of physical damage on cars, for insurance, rental and resale inspection workflows. Given a photo, the model outputs a pixel mask, a bounding box, a damage class and a confidence score for every damaged region it finds.
More information: https://github.com/Naiscorp-Robotics/Car-Physical-Damage-AI
Five damaged regions across three classes

Tear and paint scratches

Side panel

Single crease, high confidence

A failure case — read this one. The dent on this hood is obvious to a human, but at the default threshold of 0.7 the model returns nothing. It only appears at 0.5, scoring 0.57:

The demo images do not cover all 7 classes — the only available example of Vỡ kính / Broken glass had a readable licence plate and a phone number burned into the frame, so it was excluded rather than published.
pip install cardamage
import torch
from PIL import Image
from cardamage import AutoModel
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = AutoModel.from_pretrained("Naiscorp/car-damage-detection").to(device).eval()
overlay = model.inference(Image.open("car.jpg")) # PIL.Image with masks drawn
overlay.save("damage.png")
Structured output instead of a picture:
r = model.predict(Image.open("car.jpg"))
r["boxes"] # (N, 4) float32, xyxy in ORIGINAL image coordinates
r["scores"] # (N,) float32
r["classes"] # (N,) int64, 0..6
r["labels"] # list[str], Vietnamese
r["labels_en"] # list[str], English
r["masks"] # (N, H, W) bool, pasted back to the original resolution
| id | Tiếng Việt | English |
|---|---|---|
| 0 | Móp lõm | Dent |
| 1 | Trầy sơn | Paint scratch |
| 2 | Rách | Tear |
| 3 | Mất bộ phận | Missing part |
| 4 | Thủng | Puncture |
| 5 | Bể đèn | Broken lamp |
| 6 | Vỡ kính | Broken glass |
Using car-damage-dataset to train this model
model.py re-implements the inference algorithms of
Detectron2 (Copyright 2019-present,
Facebook, Inc. — licensed under the Apache License, Version 2.0), keeping the original module
and parameter names so that checkpoints trained with Detectron2 load without any key
remapping.