HanClinto commited on
Commit
264e17a
·
verified ·
1 Parent(s): 8911d90

Release Cornelius 2.12

Browse files
Files changed (1) hide show
  1. README.md +17 -15
README.md CHANGED
@@ -11,32 +11,34 @@ base_model: apple/mobilevit-xx-small
11
 
12
  # Cornelius — CCG Card Corner Detector
13
 
14
- MobileViT-XXS backbone with a SimCC coordinate classification head, trained to locate the four corners of a CCG card (Magic: The Gathering, Pokémon, etc.) in a photograph or video frame.
 
15
 
16
  ## Model details
17
 
18
  | Property | Value |
19
  |---|---|
20
- | Architecture | MobileViT-XXS + SimCC head |
21
  | Input | 384×384 RGB, ImageNet-normalised |
22
- | Outputs | corners (8 floats, normalised [0,1]), presence logit, sharpness scalar |
23
- | Parameters | ~1.82M |
24
- | File size | 7.1 MB (fp32 ONNX, optimised) |
25
  | Codename | cornelius |
26
- | Latest version | 1.221 (epoch 221) |
27
 
28
  ## Versions
29
 
30
  | File | Training data | Notes |
31
  |---|---|---|
32
- | `cornelius-1.221.onnx` | PackOpening + TCGplayer Listos | Fixed SimCC coordinate decoding to use peak argmax instead of soft expectation. This addresses rotated-card failures where multi-modal corner distributions decoded to implausible between-peak coordinates; see [CollectorVision issue #24](https://github.com/HanClinto/CollectorVision/issues/24). Exported from epoch 221 before the permutation-invariant-loss continuation, so this release isolates the decoder fix. |
33
- | `cornelius-1.210.onnx` | PackOpening + TCGplayer Listos | Current beta-test candidate. Combined held-out IoU 0.8857; source-specific Clint IoU 0.764 and Listos IoU 0.905. |
 
34
 
35
  ## Outputs
36
 
37
  - **corners** — 8 floats `[x0,y0, x1,y1, x2,y2, x3,y3]` in TL→TR→BR→BL order, normalised [0,1]
38
- - **presence** — raw logit; unreliable on blank images, prefer the sharpness gate
39
- - **sharpness** — mean peak of the 8 SimCC softmax distributions; blank frames ≈ 0.008, valid cards ≈ 0.03–0.07
40
 
41
  ## Usage
42
 
@@ -57,7 +59,7 @@ import onnxruntime as ort
57
  import numpy as np
58
  from PIL import Image
59
 
60
- session = ort.InferenceSession("cornelius-1.221.onnx")
61
 
62
  # Preprocess: resize to 384×384, ImageNet normalise, NCHW float32
63
  img = Image.open("photo.jpg").convert("RGB").resize((384, 384))
@@ -67,11 +69,11 @@ x = x.transpose(2, 0, 1)[None] # (1, 3, 384, 384)
67
 
68
  corners, presence, sharpness = session.run(None, {"image": x})
69
  # corners: (1, 8) — x0,y0,x1,y1,x2,y2,x3,y3 normalised [0,1], TL→TR→BR→BL
70
- # presence: (1, 1) — raw logit
71
- # sharpness: (1, 1) — use > 0.02 as a card-present gate
72
 
73
- if sharpness[0, 0] > 0.02:
74
- pts = corners[0].reshape(4, 2) # (4, 2) normalised corners
75
  ```
76
 
77
  ## Part of CollectorVision
 
11
 
12
  # Cornelius — CCG Card Corner Detector
13
 
14
+ MobileViT-XXS corner detector trained to locate the four corners of a CCG card
15
+ (Magic: The Gathering, Pokémon, etc.) in a photograph or video frame.
16
 
17
  ## Model details
18
 
19
  | Property | Value |
20
  |---|---|
21
+ | Architecture | MobileViT-XXS + global-token SimCC head |
22
  | Input | 384×384 RGB, ImageNet-normalised |
23
+ | Outputs | corners (8 floats, normalised [0,1]), compatibility presence logit, sharpness scalar |
24
+ | Parameters | ~1.06M |
25
+ | File size | 4.2 MB (fp32 ONNX, simplified) |
26
  | Codename | cornelius |
27
+ | Latest version | 2.12 |
28
 
29
  ## Versions
30
 
31
  | File | Training data | Notes |
32
  |---|---|---|
33
+ | `cornelius-2.12.onnx` / `model.onnx` | PackOpening + TCGplayer Listos | Global-token SimCC production model. Smaller than 1.x (~1.06M params vs ~1.82M) and substantially more robust under rotation/occlusion. Full-rotation stress: mean IoU 0.970411, p10 0.954621, 0 bad, 0 collapse. |
34
+ | `cornelius-1.221.onnx` | PackOpening + TCGplayer Listos | Fixed SimCC coordinate decoding to use peak argmax instead of soft expectation. This addresses rotated-card failures where multi-modal corner distributions decoded to implausible between-peak coordinates; see [CollectorVision issue #24](https://github.com/HanClinto/CollectorVision/issues/24). |
35
+ | `cornelius-1.210.onnx` | PackOpening + TCGplayer Listos | Earlier beta-test candidate. Combined held-out IoU 0.8857; source-specific Clint IoU 0.764 and Listos IoU 0.905. |
36
 
37
  ## Outputs
38
 
39
  - **corners** — 8 floats `[x0,y0, x1,y1, x2,y2, x3,y3]` in TL→TR→BR→BL order, normalised [0,1]
40
+ - **presence** — compatibility logit. For 2.x this is a constant `1.0`; prefer the sharpness gate.
41
+ - **sharpness** — mean peak of the 8 SimCC softmax distributions; use this for card-present gating.
42
 
43
  ## Usage
44
 
 
59
  import numpy as np
60
  from PIL import Image
61
 
62
+ session = ort.InferenceSession("model.onnx")
63
 
64
  # Preprocess: resize to 384×384, ImageNet normalise, NCHW float32
65
  img = Image.open("photo.jpg").convert("RGB").resize((384, 384))
 
69
 
70
  corners, presence, sharpness = session.run(None, {"image": x})
71
  # corners: (1, 8) — x0,y0,x1,y1,x2,y2,x3,y3 normalised [0,1], TL→TR→BR→BL
72
+ # presence: (1,) — compatibility logit; use sharpness instead for gating
73
+ # sharpness: (1,) — mean peak of the 8 SimCC softmax distributions
74
 
75
+ if sharpness[0] > 0.02:
76
+ pts = corners[0].reshape(4, 2)
77
  ```
78
 
79
  ## Part of CollectorVision