How To Scan And Identify Your Trading Cards With Ximilar AI

A guide for collectors and businesses looking to streamline their card-processing workflow with AI.

Michal Lukáč, Ximilar
Michal Lukáč August 5, 2024
9 minutes of reading
Learn how to streamline your card processing using artificial intelligence. This guide covers scanner setup, running the script, and results.

In the world of trading card scanning and seller tools, efficiency is crucial. Applications like CollX, VGPC, or Collectr handle millions of daily requests for card identification from images from hobby users as well as those who earn cash selling trading cards. Ximilar offers similar services, providing powerful API solutions for businesses looking to effortlessly integrate visual search and image recognition functionalities into their apps or websites, with the possibility of customization.

Today, I’d like to introduce a solution specifically designed for physical stores and warehouses to process their physical card collections quickly and efficiently using card scanners like those from Fujitsu. This tutorial is tailored for shop owners who need to handle large volumes of card images rapidly. We’ve developed a simple yet powerful script in Python 3 for card identification, condition assessment or grading. It also identifies comic books and reads slab labels from companies like PSA or Beckett. The script outputs a CSV file that can be easily imported into Google Sheets or Microsoft Excel. With a few modifications, it can also be adapted for use with your Shopify store or other seller tools, such as for eBay submissions. Let’s dive in and see how this tool can streamline your card-processing workflow!

Capabilities of our AI Solution for Sports Cards and TCGs

Trading Card Games

In the previous blog post, I wrote about our REST API for identifying TCGs, sports cards, and comic book covers. The TCG identification service supports more trading card games, including the most popular ones like Pokémon, Yu-Gi-Oh!, Magic: The Gathering, One Piece, and Lorcana. For some games, it can also identify the correct language version of the card or determine if it is a foil/holographic card. Additionally, for certain TCG games, the system provides links or identification numbers to the TCG Player. You can try how it works here.

Sports Cards

For sports cards, we can identify more than 5 million trading cards across six main sports categories: baseball, hockey, football, soccer, MMA, and basketball cards. Our system also supports the identification of parallel and reprint versions, with continuous improvements. Not only does it provide the best match, but it also offers alternative options to choose from.

If the trading cards are in slabs from major grading companies like PSA, Beckett, CGC, TAG, SGC, or ACE, the system can instantly identify graded cards and provide the slab company, grade, and certificate number.

All Under One API

As you can see, the functionality is complex, offering features such as bulk trading card scanning and language support, resulting in highly accurate identification. I believe that Ximilar Collectibles Recognition services are the most accurate solutions available on the market today. It is a true game-changer for card dealers, other collectors, or companies looking to be independent of third parties like CollX, Kronozio, or Card Dealer Pro, which automatically submit your cards to their marketplaces.

With Ximilar, you can handle your trading card scanning independently using our visual search technology and deep learning models. Our solutions are also designed to suit your specific needs through continuous improvements and customization. Whether you purchase, scan, analyze, search, or sell cards in bulk, our API empowers you to manage your collection without the constraints of third-party services.

How to Analyze TCG and Sports Card Scanners With AI

Step 1 – Run The Cards Through The Scanner

Enough talk! Let’s analyze the bulk of your cards. First, you’ll need a folder with images of your cards. For testing, I’ve selected a small MTG and Pokémon card subset. You can put them on your scanner via top loader (link), or individually. Most card collectors use the Fujitsu Ricoh Fi-8170 scanner, which is one of the best scanners available. It can capture both the front and back sides of the cards.

For our purposes, we will only need the front side of the cards. To avoid unnecessary costs, remove the back side images from the folder or configure your scanner to store only the front side of the cards. Some scanners, like Fujitsu, can produce scan files with names such as 19032024-0001.jpg or 19032024-FRONT-0001.jpg. You can specify the naming format for the scan files. See the following video tutorial on how to set up a Fujitsu scanner via PaperStream Capture by MaxWaxPax:

My recommendation is to use similar settings for your Fujitsu scanner as it is in the video by MaxWaxPax and create multiple profiles for sideways and top-bottom trading card scanning. Ideally set up the scanner to produce only images for the front of the cards or distinguish the images with “front” or “back” suffix in the filename. However, if you already have an unstructured collection of card images, you can fully automate the selection of images showing the front sides using our AI Recognition of Collectibles.

Step 2 – Sign Up To Ximilar Platform

Now, you’ll need an account in our App. Simply sign up with your personal or company email to get your unique API token for service authorization. Once you are in the App, copy your API key to the clipboard and save it into some file. To access the service via API, you’ll need to purchase at least a Business plan. Both tasks – getting the API key and purchasing a Business plan – can be completed in the platform’s settings in a matter of minutes.

Sign in to the Ximilar App to see and copy your authorization token.
Sign in to the Ximilar App to see and copy your authorization token.

Step 3 – Installing Python 3

Before running the script, ensure you have Python 3 installed. Some operating systems already include a version of Python, but we require at least Python 3.6. If you’re unsure, follow this tutorial on RealPython (link), which contains installation steps for Windows, macOS, and Linux:

Installation via windows and macOS takes only a few clicks.
Installation via windows and macOS takes only a few clicks.

You should be able to write in your command line, shell or terminal the similar command. Here’s mine at Mac:

michallukac@Michals-MacBook ~ % python --version && pip --version

If you don’t know how to run commands, read a short tutorial on using the terminal/shell/command line. I recommend this tutorial by DjangoGirls or watching some YouTube videos (here’s one for Windows and one for macOS). The output from the command should look similar to my example:

Python 3.9.18

pip 23.1 from /Users/michallukac/env/devel/lib/python3.9/site-packages/pip (python 3.9)

Next, you will need to install Python libraries argparse and requests via pip command:

pip install --upgrade argparse

pip install --upgrade requests

If everything passes, you’re now ready to use the script we’ve prepared to process your folder of card images!

Step 4 – Running The Script On Trading Card Games

Running the script is simple. You’ll need to use a terminal (macOS), shell (Linux), or command line (Windows), which is why we installed Python 3. Download the following file from one of these addresses:

Put this file/script next to the folder (tcgscans) with your trading card images or scans and in the terminal, write the following command:

python process_card_scans.py --folder tcgscans --api_key YOURAPIKEY --collectible tcg --output results.csv --select_images all

Hitting the enter will execute the script on the folder of tcgscans, and the progress bar will be shown. The folder will analyze all the images in the folder (select_images). You can interrupt the script (it automatically stores the results every 10 images to your specified output CSV file):

Executing the script on trading card scan recognition.
Executing the script on trading card scan recognition.

Each analysis of a scan (sports card) will consume 10 credits from your credit supply in your Ximilar account. Our App lets you watch your credit consumption closely under Reports. The Business 100k Plan allows you to analyze 10,000 raw cards. If you need to analyze millions of cards per month or your entire collection at once, reach out to us, and we can offer you a bulk discount.

Visualization of credit consumptions
Visualization of API credit consumption per image processing operation in Ximilar App.

Step 5 – Analyzing the CSV file

Now we have our CSV file named results.csv. The CSV file contains the following fields: filename (name of the photo in the folder), status (ok or error), side (front or back), subcategory, full_name, name, year, card_number, series, set, set_code, and other additional fields.

The output format of the CSV depends on whether you analyze sports cards, TCG cards, comics, or slabs. Here is a visualization of the CSV file in Visual Studio Code:

How to analyze trading card scan with AI: a visualization of the CSV file in Visual Studio Code.
My CSV file in Visual Studio Code.

We can import the file into Google Sheets or Microsoft Excel spreadsheet, edit it as needed, or generate printable checklists. The columns and data from the CSV can also be easily added to your Shopify product files or used for eBay submissions.

Additional information for card condition (or grading) can be added to the script via the –condition (–grading) parameter. For example, if your sports card scanner provides images with filenames such as 0001.jpg, 0002.jpg, 0003.jpg, etc., the following command will process images with odd numbering (e.g., 0001.jpg, 0003.jpg, …), identify the cards (name, card number, etc.), and also compute their condition (very good, excellent, etc.):

python process_card_scans.py --folder sportsfolder --api_key YOUR_API_KEY --collectible sport --output sport.csv --select_images odd --alternative --condition

Conclusion

With Ximilar’s AI-powered solutions, identifying and documenting your trading cards has never been easier. From trading card scanning, analyzing and organizing, to finding the current average market price, every step is streamlined to save you time and effort. I hope this guide helps you optimize your trading card workflow, making it easier to manage and showcase your collection. Happy collecting, whether it’s baseball or Pokémon cards!

Michal Lukáč, Ximilar

Michal Lukáč

CEO, ML Expert & Co-founder

Michal is a CEO of Ximilar and a machine learning expert focusing mainly on image recognition, visual search and computer vision. He is interested in science, loves reading books and Brazillian Jiu-Jitsu.

Tags & Themes

Related Articles

Ximilar's AI price guide can be used for value tracking of cards and comic books, offering accurate, real-time pricing data. Image credit: Laurie Byrne and Mick Haupt, Unsplash.

Get an AI-Powered Trading Card Price Checker via API

Our AI price guide can be used for value tracking of cards and comic books, offering accurate pricing data and their history.

Read more December 2024
Comics AI identification system (Photo by Erik Mclean)

Identify Comic Books & Manga Via Online API

Get your own AI-powered comics and manga image recognition and search tool, accessible through REST API.

Read more December 2024
Optimize your product listing workflow with automated writing of product titles and descriptions.

Automate Product Descriptions With Your Own Style and Keywords

Optimize your product listing workflow with automated writing of product titles and descriptions.

Read more November 2024