CardCorpus Scanner
Models and a reference index that name Pokémon trading cards in photos: every card on a binder page, a table or in a hand, as the exact print (set and number) in any of sixteen languages (English, Japanese, Simplified and Traditional Chinese, Korean, Thai, Indonesian, French, German, Italian, Spanish, Portuguese, Latin American Spanish, Dutch, Russian and Polish), from 1996 to 2026. Each answer is the card's address in the CardCorpus dataset, an open dataset of every Pokémon card (github.com/cardcorpus/pokemon-card-dataset).
The code that runs them, a command-line tool and a local web page, is the
cardcorpus-scanner Python package: github.com/cardcorpus/pokemon-card-scanner.
from cardcorpus_scanner import Scanner
scanner = Scanner.load() # downloads this repository once
result = scanner.scan("binder-page.jpg")
for card in result["cards"]:
best = card["candidates"][0]
print(best["name"], best["set_name"], best["number"], best["print"])
best["print"] is "<set>/<card>": english/base-set/4 is card
4 of https://pokemon.cardcorpus.com/v1/sets/english/base-set.json.
What's here
| file | model | parameters | input |
|---|---|---|---|
models/detector.safetensors |
QuadDet: a card's centre, size and four corners on a stride-4 grid, MobileNetV4-small backbone | 1.4M | photo, longer side 1280 |
models/matcher.safetensors |
card matcher: DINOv3 ViT-S/16, fine-tuned, and a linear map 384 → 512 | 21.8M | straightened card, 224 × 224 centre square |
models/heads.safetensors |
orientation head (512 → 256 → 4 turns) and a card-back prototype | 0.1M | the matcher's fingerprint |
models/number-reader.safetensors |
CRNN collector number reader, CTC over 40 characters | 1.1M | grey strip, 48 × 384 |
models/picker.safetensors |
print picker: PE-Core S/16, fine-tuned | 23.8M | whole card, 448 × 320 |
models/language-classifier.onnx |
language model: LCNet-050, fine-tuned to name which of twelve languages a card is printed in (every language in the index but Dutch, Russian and Polish; one class for both Spanishes), without reading words | 1.8M | name bar, foot and rules text stacked, 448 × 336 |
models/corner-reader.safetensors |
corner reader: the number reader's CRNN, trained to read the set code and language mark at a card's foot (MEW EN, M6a F); corner-reader.json holds each set's printed code |
1.1M | 90 grey strips, 48 × 384 |
index/ |
256,022 fingerprints of pictures of 214,029 cards, the print picker's gallery (67,467 fingerprints) and the cards they show | ||
pipeline.json |
every setting of the scanner |
Weights are float32 safetensors; the index is float16. The whole repository is about 572 MB.
How the scanner uses them
Per card (the package's SPEC.md gives every number):
- Detect: QuadDet finds each card's four corners.
- Orient and fingerprint: the card is straightened in its four turns; the matcher fingerprints each and the orientation head picks the upright one.
- Retrieve: the fingerprint's 20 nearest pictures in the index, one candidate per card, ten kept.
- Straighten again at 960 × 1340.
- Read the number: the number reader reads 180 strips around the places a collector number is printed, and votes.
- Pick the print: among prints of one painting (Base Set, Base Set 2 and Legendary Collection share theirs), the picker scores each against its gallery.
- Fuse and verify: picture similarity plus weighted evidence; a training-free verifier (SIFT and a homography) compares the card with each sibling print's reference picture where those pictures differ.
- 1st Edition stamp and 9. e-Card reverse holo scores, from template matching and the strips' periodicity.
Then the language check: the language model looks at every card, and when it is sure the card is printed in another language than the pick's, the card is flagged with that language's print of it (the pick stays, unless asked). Prints of one card in several languages share a painting and a number, so the picture alone can't always tell them apart; the optional language reader settles those ties with the language model, then the corner reader, then OCR.
Training
- Matcher: DINOv3 ViT-S/16 fine-tuned to tell paintings apart, on card pictures and real photos of cards, with photo-like augmentation (perspective, rotation, lighting, colour, blur, glare, compression).
- Picker: PE-Core S/16 fine-tuned to tell apart the prints of one painting from the whole card, on the same kinds of pictures.
- Detector: trained from ImageNet weights on scenes composed from card pictures and on real photos whose cards' corners were marked or reviewed by hand.
- Orientation head: fitted on the matcher's fingerprints of cards in each of four turns.
- Number reader: trained on number strips cut from card pictures, with camera-like augmentation, and on strips from reviewed photos.
- Language model: LCNet-050 fine-tuned on card pictures (with photo-like augmentation and foil streaks) and real photos of cards in each language; three training runs averaged into one model.
- Corner reader: the number reader's shape, trained on the set codes read off card pictures and fine-tuned on real photos.
The index covers every card in the CardCorpus dataset as of 21 November 2026: the matcher's fingerprint of each card's pictures in the dataset, and of further photos of many cards, with the card each picture shows.
Evaluation
The first pick counted right when it is the exact print, on photos held out of training:
| photos | cards | right (default) | right (--catalog all) |
|---|---|---|---|
| binder pages of vintage cards, at the camera's full resolution | 641 | 629 (98.1%) | 620 (96.7%) |
| the same photos shrunk to 3000 px | 641 | 630 (98.3%) | 618 (96.4%) |
| a collection's binder pages | 1,263 | 1,233 (97.6%) | 1,180 (93.4%) |
| cards photographed with a phone | 139 | 122 (87.8%) | 101 (72.7%) |
| varied real-world photos, many small, blurred or at an angle | 672 | 585 (87.1%) | 431 (64.1%) |
Measured on 21 November 2026 with these models and the index of that day.
The default keeps to English, Japanese and Simplified Chinese prints;
--catalog all matches against all sixteen languages, and nearly all of
the cards it loses come back as the same card printed in another language
(an English card as its Italian or German print, a Japanese one as its
Korean print). Cards cut off by the photo's edge are left out, as the
scanner does by default.
A binder page of 9 to 12 cards takes about 3.6 s on Apple silicon's GPU
(an Apple M6) and about 12.5 s on its CPU.
Limits
- It knows the cards in its index. A card released after 21 November 2026 isn't there, and the scanner names the closest card it knows; a new snapshot of this repository adds new sets.
- A 1st Edition and an Unlimited copy, or a reverse holo and its standard copy, are one print to the matcher. The stamp and e-Card scores help where those copies print a tell; otherwise the scanner names the print, not the copy.
- It reads which card it is, not its condition, and wasn't tested on cards in graded slabs.
Licence
Several licences apply; LICENSE.md lists each file's. In
short: the matcher is a fine-tune of DINOv3 and is under the
DINOv3 License; the other models and
pipeline.json are under Apache 2.0; the
index is under CC BY 4.0. Built with DINOv3.
Pokémon and Pokémon character names are trademarks of Nintendo, Creatures and GAME FREAK. Card pictures and text are © The Pokémon Company, Nintendo, Creatures, GAME FREAK and, for older cards, Wizards of the Coast. This project is not produced, endorsed, sponsored or supported by, or affiliated with, any of them.
Citation
@misc{cardcorpus_scanner_2026,
title = {CardCorpus Scanner},
author = {{The CardCorpus Authors}},
year = {2026},
url = {https://huggingface.co/cardcorpus/pokemon-card-scanner}
}
Model tree for cardcorpus/pokemon-card-scanner
Base model
timm/lcnet_050.ra2_in1k