Skip to content

Slice 3: Real OCR Pipeline (Horizontal Text) #4

Description

@emcifuentesc

Parent

What to build

Replace the Python sidecar stub with the real OCR pipeline: PaddleOCR for text detection, Sudachi for tokenization and Kana reading extraction, and pykakasi for Romaji conversion. The Python worker receives an image file path via NDJSON stdin and emits a real Reading JSON with lines and tokens. The Rust Sidecar Manager and TypeScript Reading Engine from previous slices consume this real data without changes.

This slice is purely about the Python NLP pipeline — no UI or Rust changes beyond wiring real data through the existing protocol.

Acceptance criteria

  • PaddleOCR integrated in Python sidecar with bundled models
  • Sudachi integrated with bundled dictionary for tokenization and reading extraction
  • pykakasi integrated for Romaji conversion
  • Python worker processes real image → real Reading JSON (horizontal text)
  • Token schema matches agreed format: surface, kana, romaji per token
  • Punctuation included as tokens
  • Pure-Kana tokens have kana equal to surface and romaji transliterated
  • OCR confidence scores forwarded per token
  • Reading schema includes orientation field (default horizontal)
  • OCR Worker integration tests verify output shape and approximate correctness on sample images

Blocked by

Testing notes

Write integration tests using a small suite of sample images (horizontal Japanese, mixed text, empty image). Verify output JSON shape and presence of key tokens rather than exact boundaries (Sudachi tokenization may vary by version).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentReady for an AFK agent to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions