This repository provides a framework to train a custom object detection model for recognizing various Solana tokens using Apple's CreateML.
- Annotations/: Contains annotation files exported from RectLabel.
- Generated/: Output directory for the exported CreateML JSON file and trained CoreML model.
- Tokens/: Contains the download script and subdirectories for each token with their respective images.
- TokenDetector.mlproj: CreateML project file for training the object detection model.
- Python 3.x: Ensure Python is installed on your system.
- icrawler: Install using
pip install icrawler
. - RectLabel Pro: Available on the Mac App Store for image annotation.
- CreateML: Comes with Xcode - ensure you have the latest version installed.
Run the download.py
script inside the Tokens directory to fetch token images:
./download.py "solana token" "SOL" --max_num 100
- Search Query: Search query for the token (e.g., "Solana token")
- Folder Name: Folder name for images (e.g., "SOL")
- Open RectLabel Pro
- Open images folder and annotations folder
- Set images folder to
Tokens
directory - Set annotations folder to
Annotations
directory
- Set images folder to
- Draw bounding boxes around tokens and label them
- Export CreateML JSON file to
Generated
directory- Make sure
Split to train/val/text folders
is checked
- Make sure
- Open
TokenDetector.mlproj
- Create a new Model Source and version it accordingly (e.g v1, v2, v3, etc.)
- Select
train
for the training data - Press
Train
to start training the model
- Go to
Output
tab after training completes - Click
Get
to save the.mlmodel
file to theGenerated
directory