Skip to content

perf(documents): OCR on real Russian and English scans - #404

Merged
leemour merged 1 commit into
mainfrom
perf/ocr-real-scans
Nov 24, 2026
Merged

leemour merged 1 commit into
mainfrom
perf/ocr-real-scans

Conversation

@leemour

@leemour leemour commented Nov 24, 2026

Copy link
Copy Markdown
Member

Why

The synthetic OCR test put docTR with a third-party Russian model ahead of Tesseract everywhere. The owner asked to confirm that on real scans before deciding whether to port docTR and the Russian model to TypeScript on onnxruntime.

What

performance/documents/ocr-ru-en/real/README.md: 125 real pages.

  • 40 validated ru.wikisource scans (public domain), plus the same 40 as simulated phone photos.
  • 20 validated en.wikisource scans.
  • 25 CORD v2 receipt photos (CC BY 4.0).

fetch.py downloads the pages and the text revisions listed in selection.json. No images are committed.

Word recall, order ignored (%):

engine RU scans RU simulated photos EN scans EN receipt photos
tesseract-fast (cli-core 0.742.0) 89.4 84.1 98.5 38.2
tesseract-fast-psm1 (cli-core#3310) 89.4 84.1 98.5 38.2
doctr-ru-onnx, page turning on 71.5 76.5 66.9 76.5
doctr-ru-onnx, page turning off 84.4 83.5 95.0 81.2
doctr-official, page turning off 2.4 2.2 97.3 95.7
  • On real Russian scans Tesseract beats docTR with the Russian model. The synthetic lead is gone.
  • docTR's page orientation model turned about 11 upright pages upside down.
  • docTR reads two columns across.
  • docTR wins only on receipt photos, where Tesseract returns nothing for 6 of 25.

Recommendation: stay with Tesseract and --psm 1. Do not port docTR now.

run_python.py gains the -straight docTR engines. The topic and area READMEs link the follow-up.

Testing

  • biome, rumdl, ruff, pnpm docs:check.
  • A rerun of fetch.py gave the same bytes for the pages checked.

🤖 Generated with Claude Code

The synthetic OCR test put docTR with a third-party Russian model ahead
of Tesseract everywhere. The owner asked to check that on real scans
before porting docTR to TypeScript on onnxruntime.

125 real pages: 40 validated ru.wikisource scans (public domain), the
same as simulated phone photos, 20 validated en.wikisource scans and 25
CORD v2 receipt photos (CC BY 4.0). fetch.py downloads the pages and the
text revisions listed in selection.json; no images are committed.

On real Russian scans Tesseract finds 89.4 % of the words, docTR with
the Russian model 84.4 % with page turning off and 71.5 % with it on:
docTR's page orientation model turned about 11 upright pages upside
down. docTR reads two columns across. It wins only on receipt photos,
where Tesseract returns nothing for 6 of 25. Recommendation: stay with
Tesseract and --psm 1; do not port docTR now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit 13562c8 into main Nov 24, 2026
1 check passed
@leemour
leemour deleted the perf/ocr-real-scans branch November 24, 2026 22:35
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