-
Notifications
You must be signed in to change notification settings - Fork 0
session log 2026 04 14
Three main tracks completed: mecab_furigana_rs integration, Umi-OCR evaluation, and PaddleOCR-VL-For-Manga GGUF evaluation. Plus analysis of replacing Ollama with direct llama.cpp.
Goal: Replace 704 lines of inline MeCab logic in furigana.rs with the standalone
mecab-furigana-rs crate (v0.1.0).
Changes:
-
lenzu/Cargo.toml— addedmecab-furigana-rs = "0.1.0" -
lenzu/src/furigana.rs— rewritten from 704 lines to ~130 lines (thin wrapper)- Removed
#[cfg(target_os = "linux")]gate — crate handles cross-platform gracefully -
annotate()andcompare_and_maybe_overwrite()signatures preserved - All 4 tests pass
- Removed
-
README.md— addedmecab-furigana-rsto Related Crates section -
lenzu/README.md— updated tech deps table to link the crate instead of raw MeCab
Goal: Test Umi-OCR via Docker HTTP API against 3 standard test PNGs.
Prototype: prototypes/umi-ocr-eval
Results: 0/3 PASS (pre-rescale oversized images — yokogaki 711×389, tategaki/tegaki 2760×1504)
| Image | Orientation | Expected | Got | Score | Time (ms) |
|---|---|---|---|---|---|
| yokogaki | Horizontal | データを正確に読み取る |
デー々を正確に読み取る |
0.961 | 1084 |
| tategaki | Vertical | 『言語モデルのテスト』 |
き転でげんの テスイ |
0.554, 0.253 | 2360 |
| tegaki | Calligraphy | 手書きの文字サンプル |
チ書きの丈字サンプル |
0.903 | 2116 |
Verdict: Not viable for manga OCR. Vertical text completely broken (maintainer acknowledges this in issue #434). Even horizontal text has character-level errors. Images were rescaled on 2026-04-15 — re-evaluation with smaller inputs pending.
Goal: Test PaddleOCR-VL-For-Manga via llama.cpp server against the same 3 PNGs.
Prototype: prototypes/paddleocr-vl-manga
Results: 2/3 PASS (CPU-only, no CUDA toolkit — BF16 on Xeon E5-2670v3; pre-rescale images)
| Image | Orientation | Expected | Got | Tokens | Time (ms) |
|---|---|---|---|---|---|
| yokogaki | Horizontal | データを正確に読み取る |
データを正確に読み取る |
13 | 4645 |
| tategaki | Vertical | 『言語モデルのテスト』 |
今回は「言語モデルの テスト」 『言語モデルの テスト』 |
23 | 107418 |
| tegaki | Calligraphy | 手書きの文字サンプル |
手書きの文字サンプル |
11 | 104009 |
Verdict: Significantly better than Umi-OCR. Yokogaki and tegaki exact match. Tategaki has correct text present but with hallucinated prefix — potentially fixable with max_tokens tuning or post-processing. CPU times are slow (100+ seconds) due to BF16 without CUDA — expect ~1-5s with GPU. Images were rescaled on 2026-04-15 — re-evaluation with smaller inputs pending.
Ollama can load plain GGUF text models but vision models need a multimodal projector
(--mmproj), which Ollama's Modelfile has no keyword for. The official
MedAIBase/PaddleOCR-VL:0.9b on Ollama was published without the projector — text
completion only, no image input.
Documented in docs/model-evaluation.md under "To evaluate: alternative OCR models":
| Model | Link | Type |
|---|---|---|
| manga-ocr (original) | https://huggingface.co/mayocream/manga-ocr/tree/main | PyTorch weights |
| manga-ocr ONNX full | https://huggingface.co/xingliao/manga-ocr-onnx-full/tree/main | ONNX export |
| PaddleOCR-VL-For-Manga (GGUF) | https://huggingface.co/adambarbato/PaddleOCR-VL-For-Manga-GGUF/tree/main | GGUF quantized |
| PaddleOCR-VL-For-Manga (base) | https://huggingface.co/jzhang533/PaddleOCR-VL-For-Manga/tree/main | Original weights |
| PaddleOCRv5 Det For Manga | https://huggingface.co/bluolightning/PaddleOCRv5-Server-Det-For-Manga/tree/main | Detection model |
Recommended upgrade path (from external advice):
- Quick fix:
xingliao/manga-ocr-onnx-full— quantized variant, keep ort backend - Best speed/accuracy:
adambarbato/PaddleOCR-VL-For-Manga-GGUF— llama-cpp-rs backend - Lightweight:
bluolightning/PaddleOCRv5-Server-Det-For-Manga— PaddleOCR in Rust
Full analysis at docs/planning-ollama-to-llamacpp.md.
Key findings:
- lenzu already uses OpenAI-compatible
/v1/chat/completions— same API as llama-server - Streaming, logprobs, vision payloads all compatible
- Main challenge: model switching (Ollama does it transparently; llama-server needs multi-port or model reload strategy)
- Recommended path:
llama-cpp-2Rust crate for in-process inference (no server overhead) - VRAM budget: PaddleOCR-VL (1.8 GB) + qwen2.5:3b (1.8 GB) fits in 8 GB with room to spare
- Added
--skip-paddleocrflag - Added
nvidia-cuda-toolkitto apt dependencies - Added PaddleOCR-VL GGUF download section (~1.8 GB, uses curl with progress)
- Added
prototypes/paddleocr-vl-manga/model/to prevent committing GGUF files
The tategaki and tegaki PNGs were 2760x1504 (4.6-4.7 MB) — full compositor screenshots, not realistic manga bubble crops. This was fixed on 2026-04-15: images rescaled to manga-bubble-realistic sizes (yokogaki 360×197, tategaki 480×262, tegaki 480×262, sample-texts 640×349). With the rescaled images:
- manga-ocr-rs: 3/3 correct text (tategaki bracket-style 「」vs『』 only diff)
- DBNet+manga-ocr pipeline: 3/3 exact match with high confidence (95-99% OCR)
- Inference time per crop: ~1.0-1.5 s (was 25-40 s for oversized images)
| File | Change |
|---|---|
lenzu/Cargo.toml |
Added mecab-furigana-rs = "0.1.0"
|
lenzu/src/furigana.rs |
Rewritten as thin wrapper (704 → ~130 lines) |
README.md |
Added mecab-furigana-rs to Related Crates |
lenzu/README.md |
Updated tech deps table |
.gitignore |
Added prototypes/paddleocr-vl-manga/model/
|
scripts/setup.sh |
Added CUDA toolkit, PaddleOCR-VL download, --skip-paddleocr |
docs/model-evaluation.md |
Added HuggingFace model links and upgrade path |
docs/planning-ollama-to-llamacpp.md |
New — full Ollama replacement analysis |
prototypes/umi-ocr-eval |
New — Umi-OCR Docker prototype + results |
prototypes/paddleocr-vl-manga |
New — PaddleOCR-VL GGUF prototype + results |
CodeMonkeyNinja/lenzu · MIT
- technical-design
- technical-design.lens-window
- GTK-Migrations
- technical-design.OCR
- technical-design.manga-ocr
- technical-design.sarashina
- technical-design.phase4-predetect
- technical-design.cancel-inflight