No description
- Python 100%
Reworks the layout/OCR stage (Stage 1) into a coarse→fine **grid flow** that reads coordinates off a pixel-labelled grid instead of flood-fill mask measurement. One method that works identically for speech bubbles, borderless text, and sfx — and geometry is separated from transcription. ## `scripts/v0_bbox.py` — five subcommands | phase | cmd | role | |---|---|---| | 1–2 locate | `grid` / `view` | overview finds regions; `view` window is the *placement surface* (100px snap) | | 3 refine | `refine` (fanout) | per-bbox 3× tighten to pixels; re-run to confirm; also a validator | | 4 transcribe | `zoom` | clean gridless upscale; `jp` enters here | | 5 gate | `final` | typed overlay + `--missing`; read against raw for completeness | ## Pipeline wiring - New agent **`bbox-locator`** replaces `layout-verifier` — it *builds* the region list from scratch via the grid flow rather than verifying pre-existing regions. - `SKILL.md` Stage 1 rewritten; new `bbox-agent-prompt.md` (thin task template) + `bbox-workflow.md` (operational spec, phases 1–5). - **`v0_annotate.py` untouched** — the typesetter still uses `--flood`, QC still uses `--crop`. Flood-fill only lost its layout-stage role. - **JSON interface is unchanged** (`regions` + `layout_verified`), so Stages 2–10 need no changes. ## Why Flood-fill only worked on clean closed outlines — it leaked on broken bubbles and did nothing for borderless text or sfx, so the agent eyeballed anyway and burned tokens tuning seed/threshold. The grid gives the model a coordinate frame it can actually read. ## Worked example — RJ379854 p24 (sfx-heavy, clean-room) Layered validation caught **3 over-tagged motion marks** (culled at refine/zoom) and **1 mislocated sfx** (caught by the phase-5 gate) before any reached cleaning, where a false `sfx` is destructive. `page_0024.json` is included as the example (layout not finalized — bottom-tier sfx still queued for transcription). Rationale and per-phase learnings are recorded in `LESSONS.md` (2026-07-23). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: schattenan <schattenan@kagaku.eu> Reviewed-on: #8 Co-authored-by: scarlet <scarlet@kagaku.eu> Co-committed-by: scarlet <scarlet@kagaku.eu> |
||
|---|---|---|
| .claude | ||
| inbox | ||
| knowledge | ||
| scripts | ||
| works/RJ379854 | ||
| .gitignore | ||
| CLAUDE.md | ||
| LESSONS.md | ||