Skip to main content

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:

  1. โœ… Installs all Python dependencies (torch, transformers, opencv, etc.)
  2. โœ… Downloads CLIP model (~500MB, one-time)
  3. โœ… 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spark_assets-1.0.0.tar.gz (148.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spark_assets-1.0.0-py3-none-any.whl (167.8 kB view details)

Uploaded Python 3

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

Hashes for spark_assets-1.0.0.tar.gz
Algorithm Hash digest
SHA256 88d71b4ff42ef85b9fb8d3140a6532e918c1a42707741680a2118d12374c03b9
MD5 029514702748ac8497894e05ea070b48
BLAKE2b-256 9cc234b4934d187d8adfa8b9b10fa826c37fe17c9c7349187d12ff5462c4cac0

See more details on using hashes here.

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

Hashes for spark_assets-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41440795054f2b6a808e7b6deb69eb818ed141c353ebcca7a3614c07304dbf3e
MD5 5dbe222d391a647f44336b80dfca65ba
BLAKE2b-256 e34246300bfa346f949c252240fc134ba4fd21c866ee45cb5e16b20026245605

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page