Views
No views yet
| Architecture | YOLOv11s-cls (Ultralytics) |
| Input | 224×224 RGB |
| Output | logits over 2 classes: no_seatbelt, seat_belt |
| Parameters | 5.4 M |
| GFLOPs | 12.0 |
| Weights | best.pt (PyTorch, 11 MB) / best.onnx (21 MB, opset 19) |
| Val top1 | 100.0 % at epoch 8 (early-stop after 18) |
| Train epochs | 18 (early-stopped out of 40) |
no seatbelt / seat_belt).| Split | no_seatbelt | seat_belt | Total |
|---|---|---|---|
| train | 46 | 690 | 736 |
| val (15 % holdout) | 8 | 121 | 129 |
| test | 33 | 366 | 399 |
The dataset is heavily imbalanced (seat-belt class ~15× more frequent). 100 % val accuracy should be interpreted against the small negative class size. On out-of-distribution traffic footage, expect lower accuracy; combine with driver-ROI detection and a second-tier verifier.
1from ultralytics import YOLO
2model = YOLO("best.pt")
3r = model("driver_crop.jpg")
4print(r[0].probs.top1, r[0].names[r[0].probs.top1])1import cv2, numpy as np, onnxruntime as ort
2sess = ort.InferenceSession("best.onnx", providers=["CUDAExecutionProvider"])
3img = cv2.cvtColor(cv2.imread("driver_crop.jpg"), cv2.COLOR_BGR2RGB)
4img = cv2.resize(img, (224, 224)).astype(np.float32) / 255.0
5x = np.ascontiguousarray(img.transpose(2, 0, 1)[None])
6logits = sess.run(None, {"images": x})[0][0]
7print(["no_seatbelt", "seat_belt"][int(logits.argmax())], float(logits.max()))