Skip to content

perf(documents): OCR on Russian and English pages, Tesseract vs docTR vs PaddleOCR - #403

Merged
leemour merged 1 commit into
mainfrom
perf/ocr-ru-en
Nov 24, 2026
Merged

leemour merged 1 commit into
mainfrom
perf/ocr-ru-en

Conversation

@leemour

@leemour leemour commented Nov 24, 2026

Copy link
Copy Markdown
Member

Why

read_scans: local reads scans with the system tesseract (rus+eng) through cli-core 0.742.0 (ydisk 0.7.0, drive 0.75.x). The owner asked whether Tesseract is good enough. OmniDocBench puts PaddleOCR far ahead, but on English and Chinese only; nobody had compared the engines on Russian. This picks the engine behind read_scans: local.

What

performance/documents/ocr-ru-en: 56 synthetic pages (8 Russian, English and mixed documents x 7 variants: clean 300 dpi, 150 dpi, noise and blur, 2–5°, 90°, photo, phone JPEG), the generator, the runners, every engine's output and the scores. No image is committed; the generator rebuilds identical pages from the seed.

CER with case and punctuation ignored, %:

engine RU clean RU photo EN clean EN photo
Tesseract 5.3.4, Ubuntu models (as cli-core runs it) 1.0 23.7 0.1 21.0
Tesseract, tessdata_best 0.2 23.2 0.1 20.8
docTR 1.1.0 official models 77.7 76.7 0.1 0.1
docTR pipeline (OnnxTR) + community Russian PARSeq 0.6 0.3 0.6 0.5
PaddleOCR 3.7.0, eslav_PP-OCRv5_mobile_rec 0.8 26.5 0.0 38.6
  • Tesseract fails on pages on their side (CER 85); --psm 1 fixes that (2.8) at 0.3 s more per page and changes nothing else.
  • docTR ships no Cyrillic model. With a third-party Russian model it is the best on every variant, but that model was trained on synthetic renders like these pages.
  • PaddleOCR writes English words inside Russian text in Cyrillic look-alikes and reads two columns across. PaddlePaddle 3.3.1 does not run it on CPU (upstream bug); 3.2.2 does.
  • Per-word orientation models in docTR and PaddleOCR turn Russian words upside down; they are off in the final runs.

Recommendation: keep Tesseract, add --psm 1 to cli-core's command; docTR's pipeline on onnxruntime is the candidate replacement after a test on real scans.

Also: biome.json ignores the new results/ folder, and performance/documents/README.md links the page.

Testing

pnpm standards:check, pnpm lint, pnpm docs:lint, pnpm docs:check pass locally; ruff check on the Python files; the generator rebuilt byte-identical pages and the scorer the same tables.

The documents contain invented phone numbers (for example a Moscow-format +7 (495) …); none is meant to be real.

🤖 Generated with Claude Code

… vs PaddleOCR

read_scans: local runs the system tesseract (rus+eng) through cli-core. The owner
asked whether Tesseract is good enough; OmniDocBench covers English and Chinese
only. This measures Tesseract (fast and best models, and with --psm 1), docTR
(official and a community Russian model via OnnxTR) and PaddleOCR 3.7 (eslav
model, server and mobile detectors) on 56 synthetic pages: 8 documents x 7 scan
and photo variants.

Headline, CER with case and punctuation ignored:
- Tesseract: clean Russian 1.0, photos 23.7; a page on its side 85, and 2.8
  with --psm 1 at 0.3 s more per page.
- docTR official: no Cyrillic model, Russian 77.7.
- docTR pipeline + Russian PARSeq on ONNX: 0.3-0.7 on every variant.
- PaddleOCR eslav: clean Russian 0.8, photos 26.5; writes English words in
  Russian text with Cyrillic look-alikes and reads two columns across.

Recommendation: keep Tesseract as the default and add --psm 1 to cli-core's
command; treat the docTR pipeline on onnxruntime as the candidate replacement
after a test on real scans. The generator rebuilds the pages from a seed, so no
image is committed; every engine's output is in results/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit f7f67d9 into main Nov 24, 2026
1 check passed
@leemour
leemour deleted the perf/ocr-ru-en branch November 24, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant