Zum Inhalt springen
ModelAufgelistetExtern
Herunterladen

Cornelius

MobileViT-XXS corner detector trained to locate the four corners of a CCG card (Magic: The Gathering, Pokémon, etc.) in a photograph or video frame.

ArtOtherBasismodellapple/mobilevit-xx-smallVersionRevision 42e9b8dBBewertung

Modellquelle

Art
Other
Dateigröße
4,20–8,23 MB
Basismodell
apple/mobilevit-xx-small
Version
vRevision 42e9b8d
Aktualisiert
10. Okt. 2026
Downloads
5591
Quelle
Hugging Face

Quellenbeschreibung

Cornelius — CCG Card Corner Detector

MobileViT-XXS corner detector trained to locate the four corners of a CCG card (Magic: The Gathering, Pokémon, etc.) in a photograph or video frame.

Model details

PropertyValue
ArchitectureMobileViT-XXS + global-token SimCC head
Input384×384 RGB, ImageNet-normalised
Outputscorners (8 floats, normalised [0,1]), compatibility presence logit, sharpness scalar
Parameters~1.06M
File size4.2 MB (fp32 ONNX, simplified)
Local CPU speed23.2 ms / frame, 43.0 FPS (ONNX Runtime CPU, single thread, 384×384)
Codenamecornelius
Latest version2.12

Versions

FileNotes
cornelius-2.12.onnx / model.onnxGlobal-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.
cornelius-1.221.onnxFixed 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.
cornelius-1.210.onnxEarlier beta-test candidate. Combined held-out IoU 0.8857.

Evaluation

All IoU values are quadrilateral IoU between predicted and labelled card corners. bad counts predictions with IoU < 0.5; collapse counts geometrically degenerate predictions where two predicted corners nearly coincide.

Release comparison

VersionArchitectureParamsONNX sizeNormal held-out IoUFull ±50° rotation mean / p10Full-rotation bad / collapseNotes
2.12MobileViT-XXS + global-token SimCC~1.06M4.2 MB0.9689110.970411 / 0.9546210 / 0Current default model.onnx; selected production checkpoint.
1.221MobileViT-XXS + independent SimCC~1.82M7.1 MB—0.933910 / 0.928732138 / 91Strong normal detector, but vulnerable to rotation-induced corner collapse.
1.210MobileViT-XXS + independent SimCC~1.82M7.1 MB0.8857 combined——Earlier beta; reported combined held-out IoU 0.8857.

Cornelius vs fastweb-single

Cornelius remains the stable, conservative default. The fastweb-single family is also available through the stable channel for consumers that explicitly select it; it is a smaller EfficientViT-B0 global-token SimCC detector being evaluated as a faster replacement candidate. Both models use the same 384×384 input contract and produce corners, compatibility presence, and sharpness outputs.

ModelChannelNormal test IoUNormal collapseFull ±50° mean / p10 IoUFull-rotation bad / collapseONNX sizeParamsLocal CPU speed
Cornelius 2.12stable0.968911180.970411 / 0.9546210 / 04.41 MB1.05M23.2 ms / 43.0 FPS
fastweb-single 1.39stable + testing0.968839130.974255 / 0.9607571 / 03.19 MB0.77M8.4 ms / 119.4 FPS

Takeaways:

  • Normal accuracy is effectively tied: fastweb-single trails Cornelius by 0.000072 IoU on the normal held-out test.
  • fastweb-single is about 28% smaller on disk and about 2.8× faster in the local single-thread CPU benchmark.
  • fastweb-single has stronger rotation-stress mean and p10 IoU, but still has one remaining bad rotation-stress case where Cornelius has zero.
  • The current published fastweb-single ONNX uses the same argmax SimCC decoding style; small post-hoc parabolic peak-refinement gains were observed in local experiments but are not baked into this artifact.

Speed benchmark details: ONNX Runtime 1.24.4, CPUExecutionProvider, intra_op_num_threads=1, inter_op_num_threads=1, 50 warmup runs and 300 timed runs on a 384×384 float32 input. These numbers are intended for model-to-model comparison on the same machine, not as universal device benchmarks.

Cornelius 2.12 checkpoint selection

The 2.12 release was selected from a low-LR continuation because it best balanced normal accuracy and stress robustness:

CheckpointNormal test IoUNormal collapseFull ±50° mean IoUp10 IoUbadcollapse
epoch 90.968923190.9688920.95278710
epoch 12 / 2.120.968911180.9704110.95462100
epoch 140.968777180.9686600.95248100

Occlusion + rotation smoke test

Three hand-picked occlusion stress samples were swept through the same full rotation preset. The 2.12 numbers below are from the Hugging Face-downloaded model.onnx.

ModelMean IoUp10 IoUbadcollapse
Cornelius 2.120.8887890.79569600
Frozen global-token prototype0.7720390.67314100
Hydra4 reduce4_h64 prototype0.7360710.64844700
Cornelius 1.x baseline0.6879370.4064982221

Per-sample Cornelius 2.12 results:

SampleMean IoUp10 IoUmin IoUbadcollapse
Ingenious Skaab0.9630760.9517560.93989800
LTR 5660.8830240.8470240.83624400
Wall of Fire0.8202690.7792520.76354100

Outputs

  • corners — 8 floats [x0,y0, x1,y1, x2,y2, x3,y3] in TL→TR→BR→BL order, normalised [0,1]
  • presence — compatibility logit. For 2.x this is a constant 1.0; prefer the sharpness gate.
  • sharpness — mean peak of the 8 SimCC softmax distributions; use this for card-present gating.

Usage

The easiest way to use Cornelius is through the CollectorVision library, which wires it into a full detect → dewarp → embed → identify pipeline:

import collector_vision as cvg

cvid = cvg.Identifier(cvg.HFD("HanClinto/milo", "scryfall-mtg"))
result = cvid.identify("photo.jpg")
print(result.ids)  # {"scryfall_id": "..."}

Direct ONNX usage

import onnxruntime as ort
import numpy as np
from PIL import Image

session = ort.InferenceSession("model.onnx")

# Preprocess: resize to 384×384, ImageNet normalise, NCHW float32
img = Image.open("photo.jpg").convert("RGB").resize((384, 384))
x = np.array(img, dtype=np.float32) / 255.0
x = (x - [0.485, 0.456, 0.406]) / [0.229, 0.224, 0.225]
x = x.transpose(2, 0, 1)[None]  # (1, 3, 384, 384)

corners, presence, sharpness = session.run(None, {"image": x})
# corners: (1, 8) — x0,y0,x1,y1,x2,y2,x3,y3 normalised [0,1], TL→TR→BR→BL
# presence: (1,) — compatibility logit; use sharpness instead for gating
# sharpness: (1,) — mean peak of the 8 SimCC softmax distributions

if sharpness[0] > 0.02:
    pts = corners[0].reshape(4, 2)

Part of CollectorVision

Used together with HanClinto/milo in the CollectorVision inference library.

Quellen

1 Quelle
Hugging FacePrimärVersion 42e9b8dca7ecb09edd13039332ef82620973d238
huggingface.co/HanClinto/cornelius/tree/42e9b8dca7ecb09edd13039332ef82620973d238

Verifiziert 10. Okt.

Modellartefakte

6 Artefakte

cornelius-1.164.onnx

onnx · 8,23 MB · SHA-256 e190c0f3b782…78a6 · Hugging Face

Herunterladen

cornelius-1.205.onnx

onnx · 8,23 MB · SHA-256 a90ee87a4578…6a79 · Hugging Face

Herunterladen

cornelius-1.210.onnx

onnx · 7,12 MB · SHA-256 c0fe2c1935af…103a · Hugging Face

Herunterladen

cornelius-1.221.onnx

onnx · 7,12 MB · SHA-256 56752ee6149e…7834 · Hugging Face

Herunterladen

cornelius-2.12.onnx

onnx · 4,20 MB · SHA-256 650da3cc3e9a…612e · Hugging Face

Herunterladen

model.onnx

onnx · 4,20 MB · SHA-256 650da3cc3e9a…612e · Hugging Face

Herunterladen

Quellenauszüge

3 Auszüge

--- license: agpl-3.0 library_name: collectorvision tags: - onnx - object-detection - card-detection - mobilevit base_model: apple/mobilevit-xx-small --- # Cornelius — CCG Card Corner Detector MobileViT-XXS corner detector trained to locate the four corners of a CCG card (Magic: The Gathering, Pokémon, etc.) in a photograph or video frame. ## Model details | Property | Value | |---|---| | Architecture | MobileViT-XXS + global-token SimCC head | | Input | 384×384 RGB, ImageNet-normalised | | Outputs | corners (8 floats, normalised [0,1]), compatibility presence logit, sharpness scalar | | Parameters | ~1.06M | | File size | 4.2 MB (fp32 ONNX, simplified) | | Local CPU speed | 23.2 ms / frame, 43.0 FPS (ONNX Runtime CPU, single thread, 384×384) | | Codename | cornelius | | Latest version | 2.12 | ## Versions | File | Notes | |---|---| | `cornelius-2.12.onnx` / `model.onnx` | 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. | | `cornelius-1.221.onnx` | 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). | | `cornelius-1.210.onnx` | Earlier beta-test candidate. Combined held-out IoU 0.8857. | ## Evaluation All IoU values are quadrilateral IoU between predicted and labelled card corners. `bad` counts predictions with IoU `< 0.5`; `collapse` counts geometrically degenerate predictions where two predicted corners nearly coincide. ### Release comparison | Version | Architecture | Params | ONNX size | Normal held-out IoU | Full ±50° rotation mean / p10 | Full-rotation bad / collapse | Notes | |---|---:|---:|---:|---:|---:|---:|---| | 2.12 | MobileViT-XXS + global-token SimCC | ~1.06M | 4.2 MB | 0.968911 | 0.970411 / 0.954621 | 0 / 0 | Current default `model.onnx`; selected production checkpoint. | | 1.221 | MobileViT-XXS + independent SimCC | ~1.82M | 7.1 MB | — | 0.933910 / 0.928732 | 138 / 91 | Strong normal detector, but vulnerable to rotation-induced corner collapse. | | 1.210 | MobileViT-XXS + independent SimCC | ~1.82M | 7.1 MB | 0.8857 combined | — | —...

Source context: 5591 downloads · 0 likes · Pipeline object-detection · Library collectorvision · Repo HanClinto/cornelius

Source context: 447 downloads · 0 likes · Pipeline object-detection · Library collectorvision · Repo HanClinto/cornelius