pokemon-card-detector
Finds every Pokémon card in a photo and returns its four corners (top-left, top-right, bottom-right, bottom-left of the upright card). YOLO11n-pose, 640 px, one class. Distilled from the CardCorpus QuadDet detector. About 5x faster than the teacher on one CPU thread (25 ms vs 131 ms) with similar recall.
Inspired by and built on CardCorpus: their QuadDet is the teacher. Code and full results: https://github.com/LeopoldTr/pokemon-card-scan.
Files
| File | Size | Threshold |
|---|---|---|
card-detector-640-fp32.onnx |
11.0 MB | 0.525 |
card-detector-640-int8.onnx |
3.4 MB (static QDQ) | 0.625 |
Input images 1x3x640x640 float32 RGB in [0, 1], letterboxed with grey 114. Output output0 1x17xN: box (cx, cy, w, h), score, 4 keypoints (x, y, visibility), in input pixels. NMS is not in the graph (IoU 0.6). example.py does the whole thing:
pip install onnxruntime opencv-python numpy
python example.py card-detector-640-fp32.onnx photo.jpg
Results
Held-out classified-ad photos with human-reviewed boxes (239 photos, 291 cards), threshold picked on a separate validation split:
| Precision | Recall (all cards) | Corner error (px, long side 1600) | CPU ms, 1 thread | |
|---|---|---|---|---|
| Teacher (QuadDet) | 0.898 | 0.901 | reference | 131.5 |
| This model, fp32 | 0.963 | 0.882 | 31.4 | 24.8 |
| This model, int8 | 0.959 | 0.873 | 31.2 | 36.8 (19.2 on 4 threads, fp32: 21.0) |
End to end (CardCorpus matcher, picker, verifier and number reader fed with these boxes instead of QuadDet): top-1 card identification 95.5 % vs 97.3 % with the teacher, difference -1.7 points, 95 % CI [-4.7, +1.0]. Other candidates, other splits and caveats (small test set, eBay/slab references are teacher boxes): https://github.com/LeopoldTr/pokemon-card-scan#why-this-one.
Training
Teacher boxes on eBay, slab and classified-ad photos, human-reviewed boxes on classified ads, synthetic card scenes for warm-up; classified-ad test/validation photos and all of slabs (762 photos, second protocol) were held out. Recipe in training/ of the GitHub repository. Dataset: https://huggingface.co/datasets/LeoTri/pokemon-card-photos.
Limitations
Trained on photos of cards in listings (hands, tables, binders, slabs, sleeves); not tested on video, on cards on a scanner bed or on non-Pokémon cards. It inherits the teacher's misses. One class: it does not tell a card from a card back, a box or a fan print reliably (the review marks such outlines not_card).
Licence
AGPL-3.0 (LICENSE): the weights derive from Ultralytics YOLO11 pose weights, which are AGPL-3.0. Anyone offering the model as a network service must offer the corresponding source under the same licence. Code in the GitHub repository is Apache-2.0.
Credits and citation
CardCorpus (teacher; Apache-2.0 code, matcher under the DINOv3 License), Ultralytics YOLO, TCGdex (card ids).
@misc{tripot2026pokemoncardscan,
author = {Tripot, L{\'e}opold},
title = {pokemon-card-scan: a small corner detector and a labelled photo set for Pok{\'e}mon cards},
year = {2026},
howpublished = {\url{https://github.com/LeopoldTr/pokemon-card-scan}},
note = {Distilled from the CardCorpus QuadDet detector}
}
Model tree for LeoTri/pokemon-card-detector
Base model
Ultralytics/YOLO11