"""Shared folder layout. Everything this toolkit writes lives under one work directory (default: ``/data``, which is git-ignored). Override the whole tree with ``OCR_WORK_DIR`` or any single folder with its own variable: OCR_WORK_DIR root of all outputs default /data OCR_MODELS_DIR downloaded weights default $OCR_WORK_DIR/models OCR_UPSTREAM_DIR official code checked out at a pin default $OCR_WORK_DIR/upstream OCR_PREPARED_DIR converted training data default $OCR_WORK_DIR/prepared OCR_RUNS_DIR checkpoints, predictions, scores default $OCR_WORK_DIR/runs """ import os from pathlib import Path REPO_ROOT = Path(__file__).resolve().parents[1] WORK_DIR = Path(os.environ.get("OCR_WORK_DIR", str(REPO_ROOT / "data"))) MODELS_DIR = Path(os.environ.get("OCR_MODELS_DIR", str(WORK_DIR / "models"))) UPSTREAM_DIR = Path(os.environ.get("OCR_UPSTREAM_DIR", str(WORK_DIR / "upstream"))) PREPARED_DIR = Path(os.environ.get("OCR_PREPARED_DIR", str(WORK_DIR / "prepared"))) RUNS_DIR = Path(os.environ.get("OCR_RUNS_DIR", str(WORK_DIR / "runs")))