
Categories
Engineering
Holo Folder is my side project for keeping track of a trading card collection: your binders, what you own and what it’s worth. One of its features is scanning, where you point your phone at a card, or a whole binder page, and it works out which cards they are.
Easy, right?…
Why reading text wasn’t working
Until now, scanning worked by reading text. It cut out the card’s name and collector number, ran those through OCR in the browser and searched for whatever it read.
On an iPhone, that’s close to the worst setup you can have. Chrome’s built-in text detector is still behind a flag and Safari’s is broken in iOS 18, so every iPhone user falls back to Tesseract, which really struggles with small, stylised text. Card text is about as small and stylised as it gets, usually behind a sleeve that’s catching the light.
Binder pages were even harder. The scanner straightened the page, split it into a 3×3 grid and cut out each pocket, but by then the photo had been shrunk to 1,200 pixels on its longest side, so each pocket was only about 250 pixels wide. That’s just not enough to read a collector number.
Matching the picture instead
Cards are mostly artwork, so I wanted to see whether recognising the picture would work better than reading the text. It’s the same idea we used for Similar Templates at Framer: an image model turns each picture into a fingerprint, a list of 384 numbers where similar-looking images end up with similar numbers, and then you look for the closest one.
I used DINOv3, the small ViT-S version, which is a 22 MB download. The bigger ViT-B model actually scored lower (79% against 86%) at four times the size. On my laptop it takes 40 to 65 milliseconds per photo.
I made a fingerprint for every card I have a reference image of, about 23,000 of them across English and modern Japanese sets, and tested it on real photos:
512 eBay listing photos across 30 sets, from Base Set to Mega Evolution, using the whole photo: the right card first 71% of the time, and in the top five 81%
the same photos cropped to just the card: 83% and 93%
cropped, and only comparing against cards in the same language: 86% and 94%
pockets cut out of 48 photos of my own binder pages by the current scanner: about 35%
Why the binder pages scored so low
That last number didn’t look great, so I went through 60 of the misses by hand. Most of them weren’t the model’s fault.
About 13 were bad crops, where the grid had slipped and the pocket held half a card or mostly sleeve. Six photos were too blurry or dark, and eight were older Japanese cards I don’t have reference images for. Most of the rest had the right card in second or third place, behind the same artwork in another language or a reprint.
Whenever a crop held the whole card, the first guess was nearly always right, even sleeved, upside down or with glare across it.
When to trust a match
I also hand-labelled 277 binder pockets to work out when the app should pick a card for you. If it always takes the top match, it’s right only 34% of the time, mostly because cards it has never seen can still score as high as real matches.
If it only picks when the top match scores at least 0.76 and is clearly ahead of the second, it’s right 86% of the time, but that only covers about a third of the cards. So the picture narrows things down to about five candidates, and the app only picks one when the name or number it reads agrees. Otherwise it shows you the five and you tap the right one.
What I’m changing
This changed the order of the work. Sharper crops come first: the scanner will ask the camera for full resolution, straighten the page once at that resolution, and cut each card at its own edges at around 500×700 pixels instead of a fixed 240×336 box.
Then picture matching becomes the main way to identify a card, with text reading only used to settle which print or language it is. Holo and reverse holo versions look the same in flat reference images, so you’ll still pick the finish yourself.
The fingerprint index works out to about 384 bytes per card, so around 10 MB in total, which is small enough to keep on your phone. There’ll be a switch to download it for offline use, so it works at card shows without relying on the signal. Comparing a photo against every card is about 9 million multiplications, which should only take tens of milliseconds, so it doesn’t even need a search index.
I’ll share proper numbers once it’s all in. If you collect cards, give Holo Folder a go!
