BLOG · PRODUCT UPDATES

By Vik Paruchuri 5 mins

Indra OCR 1.1: handwriting, 80+ languages and pages at any angle

Indra OCR 1.1 reads handwriting, OCRs 80+ languages on scans, and straightens pages at any angle. OmniParseBench headline 71.4 with --math, still on CPU.

Today we’re releasing Indra OCR 1.1. The first release was fast on clean print. 1.1 is still small (a 1M-parameter OCR model, 7M parameters for the whole default pipeline), it still runs on CPU with no GPU, and it reads a lot more: handwriting, 80+ languages on scans, and pages at any angle.

On OmniParseBench, the headline goes from 62.3 to 66.7, and from 67.0 to 71.4 with --math.

releaseheadlinetexttableslayouthandwritingrotated
1.062.341.456.389.18.325.3
1.166.746.761.192.225.250.3
1.0, math67.057.554.888.68.325.1
1.1, math71.462.759.692.025.149.3

math: with --math. All scores come from OmniParseBench’s own harness, the same one behind the public leaderboard. 1.0’s scores differ slightly from our first post, which used our own harness.

The gains show up across the board, including tables (+4.8) and degraded scans (+4.7).

Handwriting

1.0 didn’t read handwriting. 1.1 does: OmniParseBench handwriting tests go from 8.3% to 25.2%.

Here’s a handwritten cursive letter from OmniParseBench. 1.0 turned it into a table of fragments. 1.1 reads every word:

Six lines of a handwritten cursive letter.
Indra OCR 1.1 output

The committee will meet again on Tuesday evening at seven.

Enclosed please find the receipt for the amount paid in full. Please forward the enclosed papers to the county clerk before Friday.

Indra OCR 1.0 output
the emmiee wil meer aqain - Iueeday evening asaeven,
fig. 1 - A handwritten cursive letter.

80+ languages

1.0 could OCR Latin, Cyrillic, Greek, Devanagari, Bengali and Chinese. Everything else came only from a digital PDF’s text layer. 1.1 OCRs Arabic, Hebrew, Japanese, Korean, Thai, Lao, Khmer, Myanmar, Sinhala, the Indic scripts, Georgian, Armenian and Ethiopic too. On held-out printed pages in 95 languages, 1.1 reaches a character F1 of 0.90 or higher on 83 of them.

A scanned Korean letter from the Anglican Diocese of Seoul, with a box around each line Indra OCR 1.1 found.
Indra OCR 1.1 output

코로나19 확산방지 대응을 위한 사목서신(8)

주님의 평화!

성령께서 우리를 부르시어 주님의 몸된 교회를 이루게 하시고, 거룩한 길로 이끌어주심을 감사하고 찬양합니다.

Indra OCR 1.0 output
旦旦中19 卧社增本 研名音 华卧 斗号州召(8)
fig. 2 - A Korean scan. 1.0 read the Hangul as Chinese characters.

The same happens with Thai script. 1.0 forced this academic calendar into Latin letters. 1.1 reads it, table rows included:

A Thai university academic calendar with a table of dates, with a box around each line Indra OCR 1.1 found.
Indra OCR 1.1 output

ปฏิทินการศึกษา ระดับประกาศนียบัตรวิชาชีพ ปีการศึกษา 2563 มหาวิทยาลัยเทคโนโลยีราชมงคลพระนคร

(ฉบับแก้ไข)

1. วันเปิดภาคการศึกษา1 ก.ค. 6316 พ.ย. 6329 มี.ค 64
2. วันปิดภาคการศึกษา11 พ.ย. 6322 มี.ค. 6431 พ.ค. 64

…

Indra OCR 1.0 output
Ugfunnsfnen szðuusznnnüoTnsivntn Unnsfnen 2563 un nonáunalulamvusnanszuns (aWuunlo)
fig. 3 - A Thai academic calendar, read by OCR.

And with Hebrew script, which 1.0 read as letters and digits:

A page of Hebrew-script text in a serif font, with a box around each line Indra OCR 1.1 found.
Indra OCR 1.1 output

1 ברישא ברא יי בלשמא ולארעא והות כתיב 2 ועל ארעא הוה חשוכא …

Indra OCR 1.0 output
bb) 2 bpb pb) fDObb fobbb = fob fDb 1 fD) fOOp bb bb FOODb) …
fig. 4 - A page in Hebrew script, output right to left in reading order.

Per script, on OmniParseBench:

scripttests1.01.1
Latin9,40656.661.7
Korean244.283.3
Hebrew3026.780.0
Armenian6046.7100
Greek10444.255.8
Ethiopic4337.2100
Vietnamese2665.480.8
Hausa2369.691.3
Thai3928.287.2
Lao5238.596.2
Khmer3438.270.6
Tamil2528.084.0
Telugu3342.487.9
Kannada4845.893.8
Malayalam4037.565.0
Gujarati1540.080.0

Most scripts have few tests, so one test moves a score by 2 to 8 points. Myanmar and Sinhala are new too. Latin-script languages gain as well, such as Vietnamese (65.4 to 80.8) and Hausa (69.6 to 91.3).

Pages at any angle

Scans and phone photos are rarely straight. 1.1 straightens pages tilted up to 45 degrees, and turns sideways and upside-down pages upright, so a page at any angle reads. In our tests, a page tilted 30 degrees went from almost no text in 1.0 to the same accuracy as an upright page. Light text on a dark background, like slides and dark table headers, reads too.

Here’s a memo tilted 30 degrees. 1.0 returned nothing. 1.1 finds the angle and reads the page exactly as it reads the upright page:

A memo from the Office of Management and Budget, tilted 30 degrees, with a box around each line Indra OCR 1.1 found.
Indra OCR 1.1 output

EXECUTIVE OFFICE OF THE PRESIDENT OFFICE OF MANAGEMENT AND BUDGET WASHINGTON, D.C. 20503

December 18, 2019

MEMORANDUM FOR USERS OF OMB CIRCULAR NO. A-11

FROM: Hee Jun Chief, Budget Concepts Branch SUBJECT: Revisions to OMB Circular No. A-11 dated June 28, 2019

We have updated the electronic version of OMB Circular No. A-11 to reflect some technical revisions.

…

Indra OCR 1.0 output
(empty)
fig. 5 - A page tilted 30 degrees.

Here’s a table printed sideways on a journal page. 1.0 got nothing useful from it. 1.1 turns it upright and reads the whole table:

A journal page with Table 2, Impact of cancer on COVID-19 outcomes in closed cases, printed sideways.
Indra OCR 1.1 output

Table 2. Impact of cancer on COVID-19 outcomes in closed cases.

CharacteristicsDischargep-value…
AgeMean ± SD58.0 ± 15.163.8 ± 13.20.026…
GenderFemale80 (57.1)20 (47.6)0.29…

…

fig. 6 - A table printed sideways. 1.1 passes all 14 of OmniParseBench's tests on this page, and 1.0 passed none.

Chinese layout

Chinese text blocks are no longer mistaken for tables. On OmniDocBench, 1,651 Chinese and English pages read in OCR mode, the text error on Chinese pages drops by 19%, and Chinese pages that wrongly got a table go from 129 to 89 of 493:

OmniDocBench (OCR only)1.01.1
text edit distance, Chinese ↓0.2920.237
text edit distance, English ↓0.1100.114
table TEDS ↑0.4360.466

Speed

1.1 reads far more, and it still runs on CPU. On OmniParseBench, one page at a time on an x86 machine with 4 vCPUs, the median page takes 212 ms, or 357 ms with --math. That’s about 16% more time per page than 1.0 on the same machine. Digital PDFs with a good text layer still skip OCR and stay fast.

On an x86 AMD EPYC (Genoa) machine with no GPU, in OCR mode with one single-threaded worker per core, 1.1 reads about 44 pages per second on 32 cores. That’s 15x Tesseract and 10x PaddleOCR’s PP-OCR text models on the same machine type:

pages per second, AMD EPYC (Genoa)4 cores8 cores16 cores32 cores
Indra OCR 1.16.211.923.743.9
Tesseract 50.781.372.272.92
PaddleOCR PP-OCR text models0.651.242.424.28

300 OmniParseBench pages, OCR mode. PP-OCR text models: RapidOCR PP-OCRv6 small.

Quickstart

pip install -U indra-ocr
indra-ocr paper.pdf                   # markdown to stdout
indra-ocr scan.png --format json      # lines, boxes, layout blocks
indra-ocr notes.jpg --math            # math as LaTeX

Limitations

  • Handwriting: clear writing reads well. Cursive and faint pencil are harder.
  • Complex tables: tables with merged cells or multi-level headers can lose some structure.
  • Diacritics: in a few Latin-script languages with many diacritics, such as Czech, Turkish and Kurmanji, a letter can come out with a similar diacritic.
  • Text-layer-only scripts: Tibetan, Mongolian and Cantonese-only characters come from a PDF’s text layer, not from OCR.

The full list is in the README.

Try it

Tell us what you run it on, and where it breaks.

START

Get started in minutes.

Free tier. No credit card. SOC 2 Type II.