Files
pf-ocr/ocr/__init__.py
Poison Flower 35b7be680e feat(ocr): unify config, add manga translation pipeline and context lookahead
- Consolidate module configs into root config.example.json with ocr, vision, and epub sections

- Split LLM OCR workflows into novel_ocr.py (prose) and manga_ocr_llm.py (manga)

- Remove gemini_direct_ocr.py in favor of OpenAI-compatible API endpoints

- Support direct manga translation via --translate, --target-lang, and glossary.md

- Add bidirectional context support: past translations (--context-pages) and lookahead Japanese text (--context-pages-ahead)

- Add per-page JSON audit logging under logs/ and expose OpenAI sampling parameters
2026-09-06 15:42:29 +03:00

29 lines
1.5 KiB
Python

"""
OCR module: batch-transcribes (or translates) scanned pages into per-page
.txt files. Light novel and manga pages are handled by separate scripts,
since their layouts need genuinely different logic (dense running prose
vs. scattered, typed speech bubbles that benefit from translation +
glossary + cross-page continuity context).
Novel (light novel, dense running prose):
- novel_ocr.py Any OpenAI-compatible API (OpenRouter, a direct
provider endpoint, a self-hosted proxy, etc.)
with a multimodal model. Recommended.
- google_vision_ocr.py Classic OCR via Google Cloud Vision (no LLM,
--mode novel).
Manga (speech bubbles / narration boxes / SFX):
- manga_ocr_llm.py Any OpenAI-compatible API. Transcribe or
--translate, with --glossary and --context-pages
for cross-page continuity. Recommended.
- google_vision_ocr.py Classic OCR via Google Cloud Vision (no LLM,
--mode manga; transcription only, no translation).
- local_mangaocr_ocr.py Fully offline, no cloud account, via manga-ocr
(also supports --mode novel via column
segmentation, transcription only).
Each script is self-contained and runnable directly, e.g.:
python -m ocr.novel_ocr --input ./pages --output ./out
python -m ocr.manga_ocr_llm --input ./pages --output ./out --translate
"""