From 60ef436ce1af414fdef75c209e37a1b29d47e5e2 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 4 Sep 2026 22:29:11 +0200 Subject: [PATCH] feat: add OCR engine profiles --- CHANGELOG.md | 3 +++ TODO.md | 30 ++++++++++++++++++++++++++++++ VERSION | 2 +- routes/docker.py | 4 ++++ static/index.html | 17 +++++++++-------- static/js/engines.js | 24 +++++++++++++++++++----- static/sections/s-llms.html | 13 +++++++++++++ 7 files changed, 79 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f40e8b6..52fde71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi ## [Unreleased] ### Changed +- **OCR engine category.** Engines now includes local OCR/document-parser profiles for KDL Frontier Parser nano and + Baidu Unlimited-OCR, with custom OCR profiles, connection probes, page-image API guidance, and future Magazine + workflow integration documented in the TODO roadmap. - **Initial audiobook casts preserve dialogue boundaries.** The final cast normalization now merges adjacent narration only; same-speaker dialogue rows remain separate so Run 3 segmentation errors stay visible and do not diff --git a/TODO.md b/TODO.md index c7773af..2bc5fd9 100644 --- a/TODO.md +++ b/TODO.md @@ -283,6 +283,36 @@ codebase; benefit is relative user/reliability impact. - [ ] **P2 / M–L — Medium–high benefit — Enrich character-form UX.** Add richer inline form editing and per-form bulk-generation controls while preserving one character ID and one voice. +## Magazine reader roadmap + +Magazines are a separate Studio document type: they use a narrator and layout-aware article extraction, not character +casting. The original PDF remains the visual source of truth while approved articles become linked, reflowable HTML. + +### P0 — Magazine foundation + +- [ ] Add a Magazine project type beside Books and Theater Plays. +- [ ] Add PDF/JPG/PNG import with page previews and safe local storage. +- [x] Add OCR-engine selection from Engines > OCR & Document Parsing, with page-image input and structured output. +- [ ] Detect contents/index pages and propose article titles, authors, and page ranges. +- [ ] Build a review screen where users approve or correct article boundaries before TTS. +- [ ] Preserve source coordinates for every extracted block, image, caption, and page reference. + +### P1 — Magazine listening experience + +- [ ] Generate clean article HTML with headings, captions, figures, sidebars, and page links. +- [ ] Generate narrator audio per article with resume/progress and a play-all queue. +- [ ] Synchronize paragraph/sentence highlighting with playback and keep PDF and article views linked. +- [ ] Show article images or page crops during playback, with optional caption reading. +- [ ] Add confidence warnings, extraction diffs, and manual text correction before audio generation. + +### P2 — Advanced magazine intelligence + +- [ ] Improve cross-page continuation detection and automatic sidebar/advertisement exclusion. +- [ ] Add image descriptions, chart/table handling, and optional spoken figure summaries. +- [ ] Add word-level karaoke timing and EPUB 3 Media Overlay export. +- [ ] Add mobile/driving mode with large controls, automatic article advance, and hands-free resume. +- [ ] Add OCR-engine benchmark comparisons and per-page fallback selection. + Three full regression runs of *Der Sturm* against the hand-corrected reference. Everything below is measured, not estimated. Artefacts live in `config/regression_snapshots/der_sturm/` (`*_manual.json` are the human diff --git a/VERSION b/VERSION index d905a6d..61b813d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.25.1 +1.25.2 diff --git a/routes/docker.py b/routes/docker.py index 1178b09..958b1a4 100644 --- a/routes/docker.py +++ b/routes/docker.py @@ -43,6 +43,8 @@ _LOCAL_CONTAINER_DEFS: list[dict] = [ {"name": "voicebox", "label": "Voicebox", "role": "llm", "port": 17493, "stack": "voicebox", "image": "local", "repo": "", "description": "Companion voice app/control plane. Not used as a normal TTS engine unless wrapped as an API."}, {"name": "stt-whisperx-blackwell", "label": "WhisperX · faster-whisper (Blackwell GPU)", "role": "stt", "port": 8003, "stack": "whisperx-blackwell", "image": "local", "repo": "https://github.com/m-bain/whisperX", "description": "WhisperX transcription/alignment service using faster-whisper on the Blackwell GPU. Use as custom STT if its API is OpenAI-compatible or /transcribe."}, {"name": "xtts-dgx-spark", "label": "XTTS v2", "role": "tts", "port": 8005, "stack": "xtts_v2", "image": "local", "repo": "https://github.com/daswer123/xtts-api-server", "description": "XTTS v2 OpenAI-compatible speaker endpoint."}, + {"name": "ocr-kdl-frontier-parser-nano", "label": "KDL Frontier Parser nano", "role": "ocr", "port": 8099, "stack": "", "image": "local", "repo": "https://huggingface.co/KDLAI/KDL-Frontier-Parser-nano", "description": "Local 1.2B document parser for layout detection, OCR, tables, figures, and reading order."}, + {"name": "ocr-baidu-unlimited-ocr", "label": "Baidu Unlimited-OCR", "role": "ocr", "port": 8098, "stack": "", "image": "local", "repo": "https://github.com/baidu/Unlimited-OCR", "description": "Local long-document OCR and layout parser with single-image and multi-page/PDF workflows."}, ] @@ -153,6 +155,8 @@ async def probe_url(url: str, type: str = "", provider_api_key: str = Header("", checks = [("/health", None), ("/v1/models", "data"), ("/v1/audio/transcriptions", None)] elif type == "tts": checks = [("/health", None), ("/v1/health", None), ("/v1/audio/voices", None), ("/speakers", None), ("/voices", None)] + elif type == "ocr": + checks = [("/health", None), ("/v1/models", "data"), ("/v1/chat/completions", None), ("/parse", None), ("/ocr", None)] elif type == "comfyui": checks = [("/system_stats", "system")] else: diff --git a/static/index.html b/static/index.html index 3a36832..9406c91 100644 --- a/static/index.html +++ b/static/index.html @@ -10,7 +10,7 @@ - + @@ -27,12 +27,12 @@ - - - - - - + + + + + + @@ -220,6 +220,7 @@ + + +
+
+

OCR & Document Parsing

+

Configure local OCR and layout-aware document parsers for scanned PDFs, images, and future Magazine projects.

+
+
+ + + 100% Local +
+
@@ -809,6 +821,7 @@ +