Prithv122 commited on
Commit
be16623
Β·
verified Β·
1 Parent(s): 403a818

Run 2A checkpoint (RF-DETR-S, rfdetr 1.11.0) and model card

Browse files
Files changed (2) hide show
  1. README.md +125 -0
  2. checkpoint_best_total.pth +3 -0
README.md ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: rfdetr
4
+ pipeline_tag: object-detection
5
+ tags:
6
+ - object-detection
7
+ - rf-detr
8
+ - computer-vision
9
+ ---
10
+
11
+ # Weightlifting-plate detector (RF-DETR-S, Run 2A)
12
+
13
+ An 11-class object detector for weightlifting plates in side-on photos of a loaded barbell
14
+ sleeve: the ten plate weights from 0.5 kg to 25 kg, plus the collar. It is RF-DETR-S fine-tuned
15
+ with `rfdetr` 1.11.0. This is the **Run 2A** checkpoint, the one the project ships.
16
+
17
+ Code, dataset audit, pre-registered protocols and every number on this page:
18
+ https://github.com/Prithv122/custom-detector
19
+
20
+ ## Files
21
+
22
+ | File | Size (bytes) | SHA-256 |
23
+ |---|--:|---|
24
+ | `checkpoint_best_total.pth` | 127,623,409 | `f802956130702712f05bfb82d8b437ea1648efe642ff90bbba2fb38a1d8bce1f` |
25
+
26
+ ## How to use
27
+
28
+ ```python
29
+ from huggingface_hub import hf_hub_download
30
+ from PIL import Image
31
+ from rfdetr import RFDETR
32
+
33
+ path = hf_hub_download("Prithv122/custom-detector", "checkpoint_best_total.pth")
34
+ model = RFDETR.from_checkpoint(path, trust_checkpoint=True, device="cpu")
35
+ det = model.predict(Image.open("sleeve.jpg").convert("RGB"), threshold=0.53)
36
+ for box, conf, name in zip(det.xyxy, det.confidence, det.data["class_name"]):
37
+ print(name, round(float(conf), 3), box.round(1))
38
+ ```
39
+
40
+ `trust_checkpoint=True` loads a pickled PyTorch file, so only load it from a source you trust.
41
+ Pin a `revision` to get the same bytes every time. The 0.53 confidence threshold is the one the
42
+ project picked for this checkpoint on the validation split, with a rule fixed before training.
43
+
44
+ ## Model
45
+
46
+ | | |
47
+ |---|---|
48
+ | Architecture | RF-DETR-S (`RFDETRSmall`: DINOv2 windowed-small encoder), input resolution 512 |
49
+ | Library | `rfdetr` 1.11.0 (Apache-2.0) |
50
+ | Classes (11) | `0.5kg` `1kg` `1.5kg` `2kg` `2.5kg` `5kg` `10kg` `15kg` `20kg` `25kg` `zacisk` (collar) |
51
+ | Training | Tesla T4 on Kaggle, 137 min, torch 2.11.0+cu128. 50-epoch budget, early stopping (patience 10), batch 8 Γ— 2 gradient-accumulation steps, lr 1e-4, seed 20261001. Best checkpoint selected on val by `rfdetr` |
52
+ | Augmentation | horizontal flip (p = 0.5) + `PlanckianJitter` (CIE D series, 4000–15000 K, p = 0.5), albumentations 2.0.8 |
53
+ | Training code | commit `4b09e46` of the GitHub repo |
54
+
55
+ ## Training data
56
+
57
+ [*Weightlifting Plates*](https://universe.roboflow.com/projektciezary/weightlifting-plates) by
58
+ ProjektCiezary, Roboflow Universe, version 10, **CC BY 4.0**. Changes made: 255 of 2,251 images
59
+ were removed (third-party competition-video crops and press photos, unlabelled images,
60
+ contradictory labels), leaving 1,996. The published split leaked near-duplicate photos across
61
+ splits, so it was replaced: train 1,263, val 331 (whole capture sessions), test 402 (one whole
62
+ capture date, 2025-05-04, never used for training). The images are side-on phone photos of one
63
+ loaded sleeve, mostly coloured bumper plates on a loading rig, taken on 7 dates between May and
64
+ November 2025.
65
+
66
+ ## Why this checkpoint
67
+
68
+ Run 1 (no colour augmentation) misread 40 of the 100 test-date 1.5 kg plates as 0.5 kg. Those
69
+ misreads all sat in front of a yellow backdrop, and recolouring the whole scene around them
70
+ flipped 24 of the 40 to a correct read. Run 2 then trained two arms on one commit, with one seed
71
+ each, and scored them by a rule written before training:
72
+
73
+ - **2C (control):** horizontal flip only.
74
+ - **2A (shipped):** horizontal flip plus a colour-temperature cast (`PlanckianJitter`).
75
+
76
+ Results on the 100 test 1.5 kg boxes (each arm at its own val-chosen threshold):
77
+
78
+ | Run | Threshold | Read as 1.5 kg (correct) | Read as 0.5 kg (the known failure) | Missed | Other |
79
+ |---|--:|--:|--:|--:|--:|
80
+ | Run 1 (reference) | 0.80 | 36 | 40 | 21 | 3 |
81
+ | 2C control | 0.67 | 40 | 51 | 6 | 3 |
82
+ | **2A shipped** | 0.53 | **72** | **25** | 0 | 3 |
83
+
84
+ - **Known failure, 1.5 kg read as 0.5 kg:** 51/100 (2C) β†’ **25/100** (2A).
85
+ - **Correct 1.5 kg reads:** 40/100 (2C) β†’ **72/100** (2A).
86
+ - **Test mAP@50–95:** 0.748 (2C) β†’ **0.762** (2A). Val mAP@50–95: 0.823 β†’ 0.821. No other
87
+ class's test AP@50–95 dropped by more than 0.011 (the limit was 0.05).
88
+ - **Pre-registered verdict: fixed.** The success criterion was that 2A misreads at most half as
89
+ many as 2C, rounded down: at most 25. 2A misread exactly 25, so **the criterion was met
90
+ exactly at the boundary**. One more misread and the verdict would have been *not fixed*.
91
+ - Paired on the same 100 boxes, 26 were misread by 2C only and none by 2A only (one-sided exact
92
+ McNemar, p = 1.5e-8).
93
+
94
+ ## Limitations
95
+
96
+ Read these before quoting any number above.
97
+
98
+ - **The test date had already been used for diagnosis.** Its errors chose the question, two
99
+ analyses measured its images, and the fix is scored on it. Run 2's numbers show that the known
100
+ failure is reduced on that date, not how the model does on a new day.
101
+ - **Run 1's untouched-date test mAP@50–95 of 0.741 remains the clean new-day generalisation
102
+ estimate.** It was measured before any of the diagnosis. The dataset has no untouched date
103
+ left, so this checkpoint has no clean new-day number of its own.
104
+ - **One seed per arm.** McNemar's test covers which boxes happen to be in the test set, not
105
+ training randomness. Retraining without the colour change moved the misread count from 40
106
+ (Run 1) to 51 (2C), which gives a sense of how much one retrain can move it.
107
+ - **Augmentation success does not prove lighting caused the original failure.** The cast
108
+ simulates the colour of the light and shifts plate and backdrop together. That a cast helps
109
+ supports "robustness to scene colour helps here". It does not show that white balance or
110
+ illumination caused the failure on that day.
111
+ - **This is not a general colour or lighting robustness claim.** The evidence is one failure
112
+ mode on one capture date. 25 of 100 test 1.5 kg plates are still read as 0.5 kg, all of them
113
+ in front of the yellow backdrop.
114
+ - **The arms used different confidence thresholds** (2C 0.67, 2A 0.53), each picked on that
115
+ arm's own val split by a rule fixed before training. At 0.53, 2A makes 12 test predictions that
116
+ match no labelled box (2C makes none). No equal-threshold comparison was pre-registered or run.
117
+ - **Narrow domain.** Side-on close-ups of one sleeve, from one dataset's phone photos on 7 dates.
118
+ It has not been tested on other gyms, plate brands, camera angles or full-bar shots.
119
+ - Val shares capture dates with train, so val scores are optimistic by design.
120
+
121
+ ## Licence and attribution
122
+
123
+ The weights are released under Apache-2.0, the licence of the RF-DETR-S base model. They were
124
+ trained on *Weightlifting Plates* by ProjektCiezary (Roboflow Universe, CC BY 4.0), filtered and
125
+ re-split as described above.
checkpoint_best_total.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f802956130702712f05bfb82d8b437ea1648efe642ff90bbba2fb38a1d8bce1f
3
+ size 127623409