Arjuna-OCR [Te&En] β€” Telugu + English document OCR

Three ONNX models for reading printed Telugu and English documents: a layout model, a text detector and a Telugu+English CTC recognizer. CPU only, no GPU and no language model.

The recognizer is new work. The layout model and the detector are reused unchanged from anandkaman/arjuna-ocr-kn-en and were validated on Telugu pages before reuse.

Measured accuracy

A frozen test of 200 real line crops from 12 held-out books β€” books that appear in no part of training, in any form.

slice lines CER character accuracy lines fully correct
all 200 3.67 96.33 % 46.5 %
Telugu 168 3.83 96.17 % 36.9 %
English 9 0.48 99.52 % 88.9 %
24–32 px 81 3.04 96.96 % 39.5 %
32–48 px 83 3.87 96.13 % 53.0 %
48+ px 30 6.22 93.78 % 46.7 %

Measured with predict_te.py as shipped β€” one crop at a time, which is how you will run it. Scoring the same model in padded batches gives 3.85; the difference is the white padding a batch adds, and the single-crop number is the one that describes what you get. The published script was checked line by line against the evaluation pipeline on all 200 crops: 200 identical, 0 different.

What changed in v2, measured on the same crops

v1 v2
all 3.93 3.67
48+ px 6.51 6.22
isolated single words (n=39) 8.91 7.89
2–3 word lines (n=34) 6.39 5.61
4+ word lines (n=106) 3.28 3.15

Both rows are scored here on the corrected labels described below, so v1's number differs slightly from the 3.95 published with it. Every word-count band improves; the gain is largest on isolated words, which is what the corpus rebuild was aimed at.

Two label defects were found and fixed before this release, by magnifying the crops to 5–7x and reading them:

  • ఁ (arasunna) dropped from the gold. Both model versions "inserted" it in the same places; it is plainly printed in all of them, and in one line the gold had written ΰ°‚ (a circle) where the page prints the crescent. Classical orthography in those books. 6 corrections across 4 lines.
  • U+200C (ZWNJ) is now stripped at decode. It is an emitting class because the synthetic corpus renders it, but it appears in none of the real labelled lines, so predicting it could only ever be wrong. predict_te.py drops it, matching the evaluation.

The English figure rests on 9 lines and 209 characters β€” one character error in the whole slice. It is reported because leaving it out would be worse, but 209 characters cannot support an English accuracy claim either way, and a larger real English set is the next piece of work. The synthetic English validation set is larger (419 lines, ~95 % line accuracy) but synthetic results have not transferred to real pages on this project.

Known weaknesses, measured

visually similar consonants 32 % of all character errors β€” the single largest class, and the one a bigger synthetic corpus did not move. ΰ°¦/ΰ°‘ (both directions, 11), ట/ΰ°± (6), ΰ°Έ/ΰ°¨ (5), ΰ°΅/ΰ°ͺ (3)
isolated single words 92.1 % character accuracy, against 96.9 % for 4+ word lines β€” an isolated token gives a CTC reader no context
unseen typefaces on books the model has seen, CER is 0.30; on these 12 held-out books it is 3.67. The gap is typeface generalisation, not reading in general
whitespace 15 % of character errors are spacing alone; some lines are read perfectly and still score an error. (An earlier release said 28 % β€” that was counted before the scorer's own space-run collapse, and was wrong.)
Telugu numerals a digits-only line is sometimes emitted empty (n=3 in the test set). ASCII digits are 98.5 % accurate with none dropped

Use

pip install onnxruntime opencv-python-headless
python predict_te.py line_crop.png                 # one line crop -> text
python predict_te.py crops/*.png --json

predict_te.py is self-contained and reproduces the evaluated path exactly (verified line by line against the scored predictions). It takes line crops, not whole pages.

For whole pages β€” layout analysis, detection, reading order, tables, Markdown/hOCR/ALTO output β€” use the published runtime, which drives all three models:

pip install arjuna-ocr

Files

models/rec/arjuna_rec_te.onnx        Telugu+English recognizer, SVTRv2-B + merged LoRA, 206-class CTC
models/rec/charset_te_v2.json        the 206 classes in head order
models/rec/charset_te_v2_META.json   normalisation map and per-class corpus frequencies
models/det/inference.onnx            text detector (PP-OCRv6 lineage), reused from the Kannada release
models/layout/arjuna_layout_v15.onnx layout model, 15 classes β€” AGPL-3.0, see models/layout/NOTICE.md
predict_te.py                        self-contained recognizer inference
MANIFEST.json                        sha256 of every model file

Licensing

The recognizer and predict_te.py are Apache-2.0. The layout model is AGPL-3.0 (DocLayout-YOLO lineage) β€” see models/layout/NOTICE.md and models/layout/LICENSE-AGPL-3.0.txt. If that licence does not suit you, the recognizer and detector work without it.

Training

The recognizer is SVTRv2-B with merged LoRA/ConvLoRA adapters and a 206-class CTC head, trained on a synthetic Telugu+English corpus (~398k lines, 53 typefaces) mixed with real labelled book lines at 0.85/0.15. Training renders from a 150-DPI point of view and normalises every crop to 32 px high.

Contact: kamananand98@gmail.com

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support