Instructions to use HanClinto/cornelius with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- CollectorVision
How to use HanClinto/cornelius with CollectorVision:
pip install git+https://github.com/HanClinto/CollectorVision huggingface_hub
from huggingface_hub import hf_hub_download import collector_vision as cvg checkpoint = hf_hub_download(repo_id="HanClinto/cornelius", filename="model.onnx") # Detector models, such as Cornelius: detector = cvg.NeuralCornerDetector(checkpoint) # Embedder models, such as Milo: embedder = cvg.NeuralEmbedder(checkpoint)
- Notebooks
- Google Colab
- Kaggle
Release Cornelius 2.12
Browse files
README.md
CHANGED
|
@@ -11,32 +11,34 @@ base_model: apple/mobilevit-xx-small
|
|
| 11 |
|
| 12 |
# Cornelius — CCG Card Corner Detector
|
| 13 |
|
| 14 |
-
MobileViT-XXS
|
|
|
|
| 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.
|
| 24 |
-
| File size |
|
| 25 |
| Codename | cornelius |
|
| 26 |
-
| Latest version |
|
| 27 |
|
| 28 |
## Versions
|
| 29 |
|
| 30 |
| File | Training data | Notes |
|
| 31 |
|---|---|---|
|
| 32 |
-
| `cornelius-
|
| 33 |
-
| `cornelius-1.
|
|
|
|
| 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** —
|
| 39 |
-
- **sharpness** — mean peak of the 8 SimCC softmax distributions;
|
| 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("
|
| 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,
|
| 71 |
-
# sharpness: (1,
|
| 72 |
|
| 73 |
-
if sharpness[0
|
| 74 |
-
pts = corners[0].reshape(4, 2)
|
| 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
|