Views
No views yet
PekingU/rtdetr_v2_r18vd
(Apache-2.0) on the Open Images "Vehicle registration plate" class, exported to a
fixed 1×3×640×640 ONNX graph that runs fully offline with ONNX Runtime.| File | Purpose |
|---|---|
plate_rtdetr.onnx | the detector (fixed 1×3×640×640, ~79 MB) |
config.json | RT-DETRv2 model config (1 class: license_plate) |
preprocessor_config.json | the image-processor settings |
pixel_values: float32[1,3,640,640], RGB, scaled ×1/255, no
mean/std normalization.logits: [1,300,1] (raw, apply sigmoid) and pred_boxes:
[1,300,4] as cx,cy,w,h normalized to [0,1].pip install onnxruntime pillow numpy1import numpy as np, onnxruntime as ort
2from PIL import Image
3
4sess = ort.InferenceSession("plate_rtdetr.onnx", providers=["CPUExecutionProvider"])
5img = Image.open("car.jpg").convert("RGB")
6W, H = img.size
7x = (np.asarray(img.resize((640, 640)), np.float32) / 255.0).transpose(2, 0, 1)[None]
8
9logits, boxes = sess.run(None, {"pixel_values": x}) # [1,300,1], [1,300,4]
10scores = 1.0 / (1.0 + np.exp(-logits[0, :, 0])) # sigmoid
11keep = scores > 0.05
12for (cx, cy, w, h), s in zip(boxes[0][keep], scores[keep]):
13 x0, y0 = (cx - w / 2) * W, (cy - h / 2) * H
14 x1, y1 = (cx + w / 2) * W, (cy + h / 2) * H
15 print(f"plate @ ({x0:.0f},{y0:.0f},{x1:.0f},{y1:.0f}) score={s:.2f}")PekingU/rtdetr_v2_r18vd on ~3,000 Open Images plate images
(the box-regression head kept its COCO pretraining; the classification head was
re-initialized for the single license_plate class). Trained with the Hugging
Face transformers Trainer; early-stopped where held-out loss bottomed (~epoch
8 of a 40-epoch run — later epochs overfit).PekingU/rtdetr_v2_r18vd) — Apache-2.0