Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ocr-dataset-manager

Caution

This project is an AI slop.

  • Nearly all of the code is generated by AI.
  • No human code reviews.
  • All human inputs will be converted into tokens and processed by AI. See CONTRIBUTING.md for details.

Use at your own risk!

A local, web-based annotation tool for building OCR training datasets from Arcaea play-result screenshots. It pairs with core-ocr, which provides the screenshot layout detection, field/icon recognition primitives, and the image hash database (ihdb) builder used for song and partner identification. Text recognition runs locally via RapidOCR (PaddleOCR onnx models).

The workflow it is built around:

  1. Bulk import a folder of screenshots. Files are content-hashed for deduplication, renamed to UUIDs, and organized into a local store.
  2. Automatic pre-recognition runs on every image: T1/T2 layout detection, numeric field OCR (score, PURE/FAR/LOST, max recall, high score, shiny pure count, early/late counts), clear-type and difficulty classification via color masks, and song/partner identification against an ihdb. B30/B50 screenshots take a different path: a layout probe classifies the bot rendering, and each card is pre-recognized individually, on request.
  3. Human review is what the UI optimizes for: every field arrives pre-filled, suspicious values are flagged by client-side consistency checks (identity equations like pure = shiny + early + late), and annotating one image is mostly "glance, correct, confirm".
  4. Confirmed values land in SQLite. Everything OCR-related is recomputable and never persisted.

B30/B50 results images (one image, many sub-components) are also a supported mode. Each card is reviewed and confirmed independently, and renderings the probe does not recognize are annotated manually. An image counts as fully reviewed once every component its layout expects has a checked row. These results are stored in their own tables, separate from the single-image device results.

Requirements

  • Python 3.11+ and uv
  • Node.js 20+ and pnpm
  • Your own data, prepared locally (see below)

What you need to provide

This repository distributes no game assets and no game-derived data. To run recognition you need, on your own machine:

  • An image hash database (ihdb) built with arcaea_offline_ocr.builders.ihdb.ImageHashesDatabaseBuilder from song jackets and partner icons you extracted yourself. Place it at data/ihdb.db (the default) or set its path via ODM_IHDB_PATH.

  • Partner icons, the song list and the characters file (the partner letter ids), extracted from an Arcaea APK:

    cd backend
    uv run python scripts/extract_assets.py /path/to/arcaea.apk

This writes data/partner_icons/, data/catalog/songlist and data/catalog/characters.json relative to the repository root.

Running

Development

The dev server proxies /api to the backend.

# backend
uv sync --all-packages
cd backend
uv run uvicorn app.main:app --port 8199

# frontend (second terminal, from the repository root)
cd frontend
pnpm install
pnpm dev

Production

The backend serves the built frontend and opens the browser itself.

uv sync --all-packages
(cd frontend && pnpm install && pnpm build)
uv run odm  # or python -m app

Run uv run odm --help for available configuration options.

Configuration

Highest to lowest priority:

  • CLI flags
  • ODM_* environment variables
  • odm.toml in the anchor directory
  • built-in defaults

Paths in the config file resolve relative to the config file's directory. Paths in the environment or on the CLI resolve relative to the current working directory.

data_dir = "data"
host = "127.0.0.1"
port = 8199
open_browser = true
# database_url = "sqlite:///..."
# ihdb_path = "ihdb.db"
Variable Default Purpose
ODM_CONFIG <anchor>/odm.toml Config file location
ODM_DATA_DIR <anchor>/data Database, image store, thumbnails, assets
ODM_DATABASE_URL sqlite in the data dir SQLAlchemy URL
ODM_IHDB_PATH <data>/ihdb.db Image hash database
ODM_HOST 127.0.0.1 Bind address
ODM_PORT 8199 Port
ODM_OPEN_BROWSER true Open a browser tab on startup

The anchor directory is the repository root in development, and the directory of the executable in the packaged bundle.

A non-writable data directory will raise a startup error.

Packaging (Windows)

backend/scripts/package_windows.py builds the frontend, then packs the backend with PyInstaller into a portable bundle, which is a folder around odm.exe that runs from anywhere:

# from the repository root
uv run backend/scripts/package_windows.py

The output is build/dist/odm/. Double-clicking odm.exe starts the server, opens the browser, and creates data/ next to the executable on first start. The ihdb and extracted assets belong in that data/ directory (What you need to provide). The console window is the server: closing it stops it.

License

AGPL-3.0-or-later.

Arcaea is a game by lowiro. This project is an independent tool and is not affiliated with or endorsed by lowiro.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages