Loading…
Loading…
PekingU/rtdetr_v2_r18vdFine-tuned RT-DETRv2 r18vd that inspects a full print sheet from a top-down camera: it detects every order on the sheet and flags common print defects, for a label/sign printing quality-control scenario.
Important note on metrics. The Trainer's logged eval_map for this run is 0.0066 — that number is an evaluation-plumbing artifact (transformers v5 prediction payload handling), not a property of the weights. The metrics below were computed with an independent manual torchmetrics pipeline over 30 validation sheets, bypassing the Trainer entirely.
Per-class AP@[.5:.95] (class order: order, smear, scratch, misprint, missing_element, misregistration, skewed_item):
| class | AP | MAR@100 |
|---|---|---|
| order | 0.988 | 1.00 |
| smear | 0.936 | 0.96 |
| scratch | 0.757 | 0.88 |
| misprint | 0.662 | 0.91 |
| missing_element | 0.620 | 0.80 |
| misregistration | 0.637 | 0.99 |
| skewed_item | 0.869 | 1.00 |
Known quirk: the model localizes reliably but its raw confidence scores are low (top scores typically 0.05–0.20). For deployment, rank detections by score rather than gating at a high threshold (e.g. keep top-K or gate around 0.05); the ranking quality is what the mAP numbers reflect.
7 classes: order (a printed label/sign card on the sheet), smear, scratch, misprint (wrong-ink block), missing_element, misregistration (colour-layer offset), skewed_item (card beyond alignment tolerance).
from transformers import AutoModelForObjectDetection, AutoImageProcessor
import torch
model = AutoModelForObjectDetection.from_pretrained("johko/rtdetr-v2-r18vd-print-sheet-qc")
processor = AutoImageProcessor.from_pretrained("johko/rtdetr-v2-r18vd-print-sheet-qc")
inputs = processor(images=sheet_image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
results = processor.post_process_object_detection(
outputs, threshold=0.05, target_sizes=inputs["pixel_values"].shape[:2]
)
The training loss decreased from 10.14 to 3.95 over 2250 steps. Trainer-logged eval metrics in trainer_state.json are unreliable for this run (see note above); the epoch trajectory of loss was used as the health signal.