A modular machine learning toolkit for detecting rare visual defects in Pokémon trading cards — starting with the iconic Wartortle Evolution Box error.
PokéPrint Inspector brings together web crawling, computer vision, and neural networks to build a complete pipeline for:
- Acquiring card images from eBay
- Extracting the evolution portrait region from cards
- Classifying those portraits as either correct (Squirtle) or defect (Wartortle)
- Authenticates using eBay’s Browse API
- Searches for listings related to evolution box errors
- Downloads images to the
images/directory
- Detects, aligns, and deskews full card images
- Crops the evolution portrait region from the top-left corner
- Saves outputs to
adjusted_images/for easy debugging
- Trains a neural network to detect misprints based on cropped ROIs
- Loads training data from the
dataset/directory - Evaluates predictions and reports results
🔁 If the full dataset is not present, the program will automatically download it from Kaggle:
🔗 Kaggle Dataset
- Contains reusable helpers for user input, colored printing, and dataset downloading
- Clone the Repository
git clone https://github.com/HeIsOdin/Pokemon.git
cd Pokemon- Create a Virtual Environment
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows- Install Dependencies
pip install -r requirements.txt- Set eBay API Credentials
export CLIENT_ID=your_ebay_client_id
export CLIENT_SECRET=your_ebay_client_secret- Download Dataset Automatically (Optional)
If the full dataset is missing, it will be fetched from Kaggle when running
main.py.
You’ll need your
kaggle.jsonAPI token from Kaggle settings. Place it in the project root or at~/.kaggle/kaggle.json.
To train the model using the full dataset, porygon.py will automatically attempt to download the data from Kaggle.
To do this, you’ll need your Kaggle API token (kaggle.json), which can be generated from your Kaggle account settings.
You can provide this token in one of two ways:
-
Linux / macOS: Save it to:
~/.kaggle/kaggle.json -
Windows: Save it to:
C:\Users\<YourUsername>\.kaggle\kaggle.json
porygon.pywill automatically detect and use this file if present.
If kaggle.json is not found, the program will prompt you to enter your Kaggle username and API key manually. This allows porygon.py to authenticate and download the dataset without needing the file.
🛡️ Security Note If you're using the official version of this project (from @HeIsOdin), your credentials will never be stored, logged, or transmitted elsewhere. That said, if you're running a modified or forked version of this project, use caution when entering API credentials manually and review the code to ensure your data is safe.
Launch the main pipeline from the root of the repo:
python main.pyYou’ll be prompted to:
- Crawl for cards (
spinarak) - Align & crop ROIs (
smeargle) - Train & evaluate the model (
porygon)
You can also run modules individually:
python -m spinarak
python -m smeargle
python -m porygon- Build a dataset of top-left evolution portraits from real-world cards
- Train a model to detect visual misprints (like Wartortle in Squirtle's place)
- Prototype AI-assisted card grading or defect screening
Pokemon/
├── main.py # Entry point for the entire pipeline
├── spinarak.py # eBay crawler module
├── smeargle.py # Image alignment and ROI extraction
├── porygon.py # CNN training and evaluation
├── miscellaneous.py # Shared helper functions
├── dataset/ # Contains subdirectories of labeled portrait images
├── images/ # Raw downloaded images from eBay
├── adjusted_images/ # Debug outputs from alignment and cropping
├── requirements.txt
└── README.md
| Role | Name | GitHub |
|---|---|---|
| Creator / Lead | Odin | @HeIsOdin |
| Mentor | Prof. Andrew Kramer | @Rewzilla |
| Collaborator | Jessica Senyah | @JessSen22 |
| Contributor | Samyam Aryal (image quality advice) | @samyamaryal |
This project and dataset are provided for educational and research purposes. Some images are derived from public listings (e.g., eBay) and may be subject to copyright. Please review usage rights before applying this work commercially.