SPARK - System for Processing & Asset Refinement Kit - Transform raw game assets into organized reference data
Project description
โก SPARK - System for Processing & Asset Refinement Kit
SPARK transforms raw game assets into organized, labeled reference data.
๐ Quick Start
# 1. Install SPARK (downloads CLIP model automatically on first run)
pip install -e .
# 2. Run on MPKG + PNG assets (100% offline after first run)
spark pipeline --input game_resources/ --output processed/ --verbose
First Run: Auto-downloads CLIP model (~500MB)
Future Runs: 100% offline, no cloud access
Mercury Support (Optional)
# One-time: Configure npm with GitHub token
npm config set @aristocrattechnologiesinc:registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com/:_authToken YOUR_GITHUB_TOKEN
# Then: merc auto-installs on first use
spark merc_pipeline --input mercury_resources/ --output processed/ --verbose
Note: SPARK auto-installs merc CLI if npm is configured. See DEMO.md for details.
๐ ๏ธ Requirements
Core Requirements
- Python 3.8+
- pip (Python package manager)
- Internet connection (first run only - to download CLIP model)
What Gets Installed Automatically
When you run pip install -e ., SPARK automatically:
- โ Installs all Python dependencies (torch, transformers, opencv, etc.)
- โ Downloads CLIP model (~500MB, one-time)
- โ Configures offline mode for future runs
After first run: 100% offline processing, no cloud access required.
Optional (For Mercury Bundle Support)
- Node.js 14+ with npm
- merc CLI - Install globally:
npm install -g @aristocrattechnologiesinc/merc
For Mercury setup, see DEMO.md.
โจ Features
- Single-command processing - Extract, classify, deduplicate in one step
- Composite image splitting - Automatically detects atlas/sprite-sheet images and splits them into individual assets
- Video / animation support - Extracts distinct scene frames from
.ogv,.mp4, and other video formats - Hybrid classification - MPKG metadata + OCR + CLIP semantic
- Smart deduplication - Perceptual hash-based (~96% reduction)
- Mercury support - DXT texture extraction via lonestar-tools
- Organized output - Clean folder structure by label
- One image = one asset - Every output file contains a single visual unit
๐ CLI Commands
| Command | Purpose |
|---|---|
spark pipeline |
Process MPKG + PNG assets |
spark merc_pipeline |
Process Mercury bundles |
spark build-reference |
Build CLIP reference embeddings |
spark flatten |
Flatten hierarchical asset folders |
spark extract |
Parse .aep projects into position-verified golden assets |
Run AEP extraction from input\AE_Files
# From repo root; writes output to output\ by default
spark extract --test-input input\AE_Files --verbose
๐ Output Structure
processed/
โโโ final_labeled_assets/
โ โโโ spin_button/
โ โโโ wild_symbol/
โ โโโ ...
โโโ pipeline_metadata.json
๐ง Python API
from spark import process_assets
results = process_assets(
input_dir="game_resources/",
output_dir="processed/"
)
print(f"Processed {results['unique_after_dedup']} unique assets")
๐ฆ Project Structure
spark/
โโโ spark/ # Main package
โ โโโ cli.py # CLI commands
โ โโโ assets/ # Processing modules
โ โ โโโ pipeline.py # Core pipeline
โ โ โโโ composite_splitter.py # Atlas/composite โ single-asset splitting
โ โ โโโ merc_rip_bridge.py # Mercury integration
โ โโโ detection/ # Detection utilities
โโโ examples/ # Usage examples
โโโ tests/ # Unit tests
โ โโโ test_core.py
โ โโโ test_composite_splitter.py
โ โโโ test_pipeline.py
โโโ input/ # Sample input data (for testing)
โโโ DEMO.md # Getting started guide
Note: merc CLI tool is installed globally via npm, not bundled in the repository.
๐ ๏ธ Requirements
- Python 3.8+
- For Mercury: Node.js + lonestar-tools merc
๐ License
MIT License - see LICENSE
SPARK - Built for game asset processing โก
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spark_assets-1.0.0.tar.gz.
File metadata
- Download URL: spark_assets-1.0.0.tar.gz
- Upload date:
- Size: 148.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88d71b4ff42ef85b9fb8d3140a6532e918c1a42707741680a2118d12374c03b9
|
|
| MD5 |
029514702748ac8497894e05ea070b48
|
|
| BLAKE2b-256 |
9cc234b4934d187d8adfa8b9b10fa826c37fe17c9c7349187d12ff5462c4cac0
|
File details
Details for the file spark_assets-1.0.0-py3-none-any.whl.
File metadata
- Download URL: spark_assets-1.0.0-py3-none-any.whl
- Upload date:
- Size: 167.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41440795054f2b6a808e7b6deb69eb818ed141c353ebcca7a3614c07304dbf3e
|
|
| MD5 |
5dbe222d391a647f44336b80dfca65ba
|
|
| BLAKE2b-256 |
e34246300bfa346f949c252240fc134ba4fd21c866ee45cb5e16b20026245605
|