datalab-to/indra-ocr
Summary
Datalab 发布 Indra OCR——一个仅约 1M 参数的轻量 OCR 模型,在 CPU 上每秒可处理多达 49 页,速度比 Tesseract 和 PaddleOCR 快 11-24 倍,可将 PDF 和图片转换为 Markdown、纯文本或带框的 JSON。
View Cached Full Text
Cached at: 10/17/26, 06:55 PM
datalab-to/indra-ocr · Hugging Face
Source: https://huggingface.co/datalab-to/indra-ocr

State of the Art models for Document Intelligence
https://huggingface.co/datalab-to/indra-ocr#indra-ocrIndra OCR
Indra OCR is a 1M-parameter OCR model that reads up to 49 pages per second on CPU. It turns PDFs and images into markdown, plain text, or JSON with boxes, and it has these features:
- Throughput - 49 pages/s, 11-17x faster than Tesseract and PaddleOCR on the same machine and pages (table)
- Latency - ~230 ms per page on 4 x86 vCPUs, 12-24x faster than Tesseract and PaddleOCR
- Accuracy - scores 41.3 onOmniParseBenchtext, ahead of PaddleOCR’s PP-OCR text models (35.8) and Tesseract (19.3). Its headline score (62.1) beats PaddleOCR’s full PP-StructureV3 pipeline (58.4).
- Layout and boxes - a bounding box for every line and every layout block, with block labels (headings, lists, tables, captions, footnotes, page headers) and reading order
- Digital PDFs - reads the PDF’s own text layer in any script, and OCRs only what is missing
- Small - about 18 MB of models on ONNX Runtime, no PyTorch
The main recognizer,rec\.onnx, has about 1M parameters. Seebenchmarksfor the full results andlimitationsfor what it does not do yet.
Indra OCR is named forIndra.

https://huggingface.co/datalab-to/indra-ocr#try-datalabs-managed-platformTry Datalab’s Managed Platform
Indra OCR is built for speed on CPUs. When you need the highest accuracy, on handwriting, math, complex tables and degraded scans, our managed platform runsChandra, our state of the art OCR model, with zero data retention by default, SOC 2 Type 2, and custom BAAs.
If you have high volume workloads, we offer a batch processing service that can handle 1B+ pages a day.
Get started with**$5 in free credits**-sign up- or try Chandra in ourpublic playground.
https://huggingface.co/datalab-to/indra-ocr#quickstartQuickstart
pip install indra-ocr
indra-ocr paper.pdf # markdown to stdout
indra-ocr *.pdf --out results/ # one .md per input, all cores
indra-ocr scan.png --format json # lines, boxes, layout blocks, confidences
indra-ocr-viewer # local web viewer on http://localhost:8765
The first run downloads the models (about 18 MB) fromHugging Face.
https://huggingface.co/datalab-to/indra-ocr#examplesExamples
Real Indra OCR outputs on OmniParseBench pages. Colored boxes are layout blocks with their label, faint blue boxes are lines, drawn from the JSON output with no edits.
See more examples, with the markdown output for each →
https://huggingface.co/datalab-to/indra-ocr#licenseLicense
The code isApache 2.0. The model weights use a modified OpenRAIL-M license (LICENSE).
https://huggingface.co/datalab-to/indra-ocr#commercial-usageCommercial usage
This code is Apache 2.0, and our model weights use a modified OpenRAIL-M license (free for research, personal use, and startups under $20M funding/revenue, cannot be used competitively with our API). To remove the OpenRAIL license requirements, or for broader commercial licensing, visit our pricing pagehere.
https://huggingface.co/datalab-to/indra-ocr#installationInstallation
pip install indra-ocr
Python 3.10 or newer. It installs ONNX Runtime, OpenCV and pypdfium2, and no PyTorch. The models download from Hugging Face on the first run and are cached. To use a local copy, setINDRA\_OCR\_MODEL\_DIRor pass\-\-model\-dir.
https://huggingface.co/datalab-to/indra-ocr#usageUsage
https://huggingface.co/datalab-to/indra-ocr#cliCLI
indra-ocr paper.pdf # markdown to stdout
indra-ocr *.pdf --out results/ # one .md per input
indra-ocr scan.png --format json # lines, boxes, layout blocks, confidences, timings
indra-ocr paper.pdf --format text # plain text, one line per detected line
indra-ocr paper.pdf --mode ocr --timings # ignore the text layer, OCR every page; timings on stderr
indra-ocr paper.pdf --keep-furniture # keep page headers and footers in the markdown
indra-ocr *.pdf --out results/ --cores 8 # limit the cores (default: all usable cores)
indra-ocr paper.pdf --math # write math as LaTeX (off by default; slower on math pages)
CLI Options:
\-\-out DIR: write one file per input (\.md,\.txtor\.jsonl)\-\-format \[md\|text\|json\]: output format (default: md)\-\-mode \[auto\|ocr\|text\]:autoreads the text layer where it passes the checks and OCRs elsewhere (default).ocrnever reads the text layer.textuses the text layer even when the checks fail\-\-model\-order: order text-layer lines with the order model, not the PDF content order\-\-no\-image\-ocr: on text-layer pages, do not OCR text inside images\-\-cores N: cores to use, one worker process each (default: all usable cores)\-\-dpi: render resolution for PDFs (default: 200)\-\-max\-pages N: read at most N pages per file\-\-password: password for encrypted PDFs\-\-keep\-furniture: keep page headers and footers in the markdown\-\-math: write math as LaTeX ($\.\.\.$); off by default, seeMath\-\-timings: print per-page source and time to stderr\-\-model\-dir: folder with the models (default: download)
The CLI continues past files it cannot read, and exits with 1 if any failed.
https://huggingface.co/datalab-to/indra-ocr#from-pythonFrom python
import indra_ocr
conv = indra_ocr.load(threads=4) # mode="auto" | "ocr" | "text"
for i, page in conv.convert("paper.pdf"):
print(page.source, page.timings["total_ms"])
print(page.markdown) # headings, lists, tables as HTML
page.blocks # [{"label", "bbox", "text"}] in reading order
page.lines # [Line(box, text, conf)] in reading order
For many pages or files,convert\_manyruns one single-threaded worker process per core, one page per task, and returns results in input order:
import indra_ocr
if __name__ == "__main__": # worker processes re-import this file
for path, result in indra_ocr.convert_many(["a.pdf", "b.pdf"], cores=None):
if isinstance(result, indra_ocr.InputError):
continue # unreadable or locked file
for i, page in result:
print(path, i, page.source)
Without theif \_\_name\_\_ == "\_\_main\_\_":guard (needed on macOS and Windows),convert\_manywarns and reads everything in one process.
indra\_ocr\.loadtakespath(model folder),threads,dpi,mode,pdf\_order,image\_ocr,furnitureandmath.conv\.converttakesmax\_pagesandpassword.
https://huggingface.co/datalab-to/indra-ocr#viewerViewer
indra-ocr-viewer --port 8765 # open http://localhost:8765
A local web viewer: drop in a PDF or an image, and each page shows its lines, layout blocks and reading order over the page, with the rendered markdown, the markdown source, the lines with their confidences, the JSON output and the time of each stage. The pipeline options (text layer or OCR, math, headers and footers, reading order, OCR of text inside images, dpi, page limit) are set in the page, and lines, blocks, block labels and reading order can each be shown or hidden. Files stay on your machine.\-\-tesseractlets the page compare with Tesseract (needspytesseractand a Tesseract install). Over SSH, forward the port:ssh \-N \-L 8765:localhost:8765 host.
https://huggingface.co/datalab-to/indra-ocr#outputOutput
Every page is aPagewith:
markdown: headings (\#\#), paragraphs, lists, and tables as HTML. Page headers and footers are left out unlessfurniture=True/\-\-keep\-furnituretext: one line per detected line, in reading orderlines:Line\(box, text, conf\), box isx0, y0, x1, y1in image pixelsblocks: layout blocks in reading order,\{"label", "bbox", "text"\}source:text(PDF text layer),ocr,hybrid(text layer + OCR of text inside images) orerrorrotation,skew: the quarter or half turn applied (degrees), and the small tilt straightenedtimings: per-step milliseconds, withtotal\_msnote: why the page took its path
Block labels:Text,Section\-Header,Page\-Header,Page\-Footer,List\-Group,Table,Caption,Footnote,Table\-Of\-Contents,Form.\-\-format jsonwrites one JSON object per page with all of these fields.
https://huggingface.co/datalab-to/indra-ocr#languagesLanguages
**OCR (scans and images):**Latin (about 50 languages), Cyrillic, Greek, Devanagari, Bengali, and Chinese (simplified and traditional). Each line with Chinese characters goes to the Chinese recognizer.
**Text layer (digital PDFs): any script.**We checked text mode on 1,125 pages from 75 language families. On pages whose layer passes the checks, Indra OCR keeps at least 98% of the layer’s characters in every family, including Arabic, Hebrew, Persian, Urdu, Thai, Khmer, Lao, Myanmar, Georgian, Armenian, Ethiopic, the Indic scripts, Chinese, Japanese and Korean. Right-to-left lines keep their right-to-left order.
https://huggingface.co/datalab-to/indra-ocr#limitationsLimitations
Indra OCR is built for speed on clean print. It is not the right tool for:
- **Complex tables.**Tables with merged or spanning cells, cell text that wraps over several lines, nested headers, or no ruling lines can come out with cells in the wrong rows or columns. Simple grid tables read well.
- **Handwriting.**Handwritten text is not supported (about 8% on the OmniParseBench handwriting tests).
- **Scripts outside the OCR list.**OCR reads Latin, Cyrillic, Greek, Devanagari, Bengali and Chinese. Other scripts, including Arabic, Hebrew, Thai, Japanese kana and Korean Hangul, work only through a digital PDF’s text layer. On scans and images they come out wrong; a Hangul line, for example, comes out as wrong Chinese characters.
- **Degraded scans.**Old, faded or low-resolution scans read poorly (about 20% on the OmniParseBench old-scan tests).
Also:
- Math comes out as plain text unless
\-\-mathis on (seeMath). - No vertical text (such as traditional Chinese newspapers).
- Very wide, banner-shaped pages read poorly.
- Labels inside engineering drawings often come out as small tables.
- Pages above 100 megapixels at 200 dpi render at a lower dpi, so small text on them can be lost.
- The orientation model turns about half of the upright Arabic and Hebrew pages that go to OCR by mistake. Do not rely on it for those scripts.
For these documents,Chandra on Datalabis the accurate option.
https://huggingface.co/datalab-to/indra-ocr#mathMath
Math is off by default. With\-\-math(orindra\_ocr\.load\(math=True\)), a small classifier finds the lines that hold math, and a second recognizer reads them as text with inline LaTeX (we have $x \_ \{ i \} \\leq 1$).
On OmniParseBench (all 2,937 pages, default settings otherwise):
headlinetexttableslayoutmath testsIndra OCR62.141.456.488.514.3Indra OCR\-\-math66.8****57.554.888.156.5PaddleOCR PP-StructureV358.455.647.871.7–
- With
\-\-math, Indra OCR is ahead of PaddleOCR’s PP-StructureV3 on the headline, text, tables and layout. Without it, PP-StructureV3 leads on text. - Tables lose 1.5 points: numbers in some table cells are read as math.
\-\-mathis slower. On x86 (AMD EPYC Genoa), one page at a time on 4 cores in auto mode, the median page takes ~360 ms with\-\-mathand ~210 ms without. With one single-threaded worker per core, throughput is about 30% lower on 4 cores and 35% lower on 32 (4.8 vs 6.8 and 29.2 vs 44.9 pages/s, measured in one container on 300 OmniParseBench pages).- The cost falls on the pages where the math path runs. In auto mode, pages read through a digital PDF’s text layer slow down most: their median time per page goes from 130 ms to 345 ms in the throughput run (one single-threaded worker per core).
- Old scanned math gains little (22.2 to 23.1).
The math models download only when\-\-mathis on.
https://huggingface.co/datalab-to/indra-ocr#benchmarksBenchmarks
https://huggingface.co/datalab-to/indra-ocr#omniparsebenchOmniParseBench
OmniParseBenchhas 16,288 pass/fail tests on 2,937 pages. The headline is the mean of the text, tables and layout families. All runs: x86, 4 vCPUs per engine, one page at a time, every engine on the same pages with the same scorer and its default settings.

engineheadlinetexttableslayoutmedian ms / pageIndra OCR (auto: text layer + OCR)62.141.356.488.6228Indra OCR (OCR only)57.533.550.988.2303Indra OCR\-\-math(auto)66.8****57.554.888.1~360†PaddleOCR PP-OCRv6 small, text models only (RapidOCR)–35.80.0–2,685PaddleOCR PP-StructureV3 (2,918 pages*)58.455.647.871.740,958Tesseract 5 (our run, Latin model)–19.30.0–5,496
- The PP-OCR text models and Tesseract output lines, not tables or layout blocks, so their table scores are 0 and their layout family is not scored.
- PP-StructureV3 is PaddleOCR’s full document pipeline (layout, tables, formulas). Without
\-\-math, it reads text better than Indra OCR (55.6 vs 41.3). With\-\-math, Indra OCR is ahead on text too (57.5). It takes about 180 times as long per page as Indra OCR’s default mode. *One of its 150 shards stalled for 6 hours on its first page, so its row leaves out 19 pages. - Faster settings exist, but we did not score their accuracy. Tesseract with the
engmodel and 1 thread takes 3.4 s a page (6.1 s as run). PP-StructureV3 without formula, seal and chart recognition, unwarping and orientation, and with its mobile OCR models, takes 10.5 s a page. Indra OCR is still 15-45x faster per page. - The OmniParseBench leaderboard’s own Tesseract run scores 17.6 on text.
- Median latency varies by about 15% between runs of the same code. †The
\-\-mathlatency is from a separate run on x86 (AMD EPYC Genoa, 4 cores, one page at a time), where the default mode gave 208 ms.
Chinese(136 OmniParseBench Chinese tests): Indra OCR 64.7, PaddleOCR PP-OCRv5 mobile Chinese text models 65.4, PP-StructureV3 68.4.
https://huggingface.co/datalab-to/indra-ocr#olmocr-bencholmOCR-bench
Born-digital splits and old scans, our harness, 200 dpi:
splitIndra OCRTesseract 4headers_footers91.235.5multi_column70.070.4long_tiny_text67.964.0table_tests60.51.0old_scans20.018.4
https://huggingface.co/datalab-to/indra-ocr#throughputThroughput
The CLI andconvert\_manyrun one single-threaded worker process per usable core, one page per task, so a single long PDF also uses every core.\-\-coreslimits it.
Pages per second. Every engine ran on the same x86 machine (AMD EPYC, no GPU) on the same 300 OmniParseBench pages, with one single-threaded worker per core, OCR mode and default settings. Indra OCR is the mean of 3 runs. The other engines ran once.
engine4 cores8 cores16 cores32 coresIndra OCR7.314.227.2****49.4Indra OCR\-\-math†~5––~30PaddleOCR PP-OCRv6 small, text models only (RapidOCR)0.651.242.424.28Tesseract 50.781.372.272.92PaddleOCR PP-StructureV3*≤ 0.022≤ 0.044≤ 0.089≤ 0.18
At 32 cores, Indra OCR is 11.5x PaddleOCR’s PP-OCR text models, 16.9x Tesseract and about 280x PP-StructureV3 (against its upper bound). *PP-StructureV3 ran a time-capped subset of the pages, so its numbers are upper bounds. †\-\-mathran in a separate container with the same CPU type and the same pages, where it gave 4.8 pages/s on 4 cores and 29.2 on 32, against 6.8 and 44.9 without it (about 30% and 35% lower).
Model loading and one warm-up page per worker are not timed. A short 300-page job throughconvert\_many, model loading included, runs at 7.2 pages/s on 4 cores and 37.7 on 32.
https://huggingface.co/datalab-to/indra-ocr#reproducingReproducing
pip install 'omni-parse-bench[benchmark]'
python bench/opb_indra.py --out runs/opb_auto --mode auto --procs 8
Each page runs in a single-threaded worker process, page headers and footers kept.\-\-mode ocrgives the OCR-only row,\-\-limit Nscores the first N pages, and\-\-modelspoints at a local model folder. The run writessummary\.json(the benchmark’s own summary, plus median and p90 ms per page) andpages\.jsonl(per page: time, source, tests passed).
https://huggingface.co/datalab-to/indra-ocr#creditsCredits
Thank you to the following open source projects:
Similar Articles
@VikParuchuri: Introducing Indra, a 1M parameter OCR model: - 49 pages/s on CPU, 11x faster than PaddleOCR and 17x Tesseract - Beats t…
Vik Paruchuri 介绍 Indra,一个仅 1M 参数的 OCR 模型,在 CPU 上实现 49 页/秒,速度比 PaddleOCR 快 11 倍、比 Tesseract 快 17 倍,并在 OmniParseBench 文本识别上取得更高精度。
@poolmoon6: OCR is often needed. I use the one below, deployed locally. In real-world tests it outperforms Baidu OCR. On July 15, 2026, Alibaba released OvisOCR2. This is an end-to-end document parsing model based on Qwen3.5-0.8B, with only 0.8B parameters. On OmniDocBench v1…
Alibaba released OvisOCR2, an end-to-end document parsing model with 0.8B parameters based on Qwen3.5-0.8B, topping OmniDocBench v1.6 with a score of 96.58 — the first time an end-to-end approach has surpassed all pipeline-based approaches — and it is released under the Apache 2.0 license for commercial use.
@CoderDaMing: China has open-sourced a peanut-sized OCR that can parse an entire 100-page PDF in one go. It's called 'Unlimited-OCR'. Only 3B parameters. Runs locally. Other OCR tools cut documents page by page, easily losing context. This one reads the entire document at once. → Single 'long-range' parse (32K context window...
China has open-sourced the OCR model Unlimited-OCR with only 3B parameters, which can parse an entire 100-page PDF in one go, supports local execution, achieves 93% accuracy, and is completely free and open-source.
@GoSailGlobal: Current OCR processes multi-page documents page by page. Every time you turn a page, memory is reset. Today, Baidu quietly open-sourced a model on GitHub and HuggingFace called Unlimited OCR, inspired by how humans copy books: - When copying a book, you don't reread hundreds of pages every time you write a word...
Baidu has open-sourced the Unlimited OCR model, which uses a Reference Sliding Window Attention (R-SWA) mechanism to parse documents up to 32K context in a single pass, eliminating the need for page-by-page inference.
@rionaifantasy: Unbelievable! How Can a 34.5M Parameter OCR Beat a 235B Large Model? Let me tell you something ridiculous: I used to believe the future of OCR would inevitably be devoured by ever-larger multimodal large models. But after seeing PP-OCRv6 released by Baidu Wenxin, I've changed my mind. Because it doesn't follow the path of "continuing to pile on parameters..."
Baidu Wenxin releases PP-OCRv6, offering three model tiers: Tiny, Small, and Medium, supporting over 50 languages. The Tiny version is only 1.5MB and can run locally in a browser, with the fastest single-image inference at 97ms, proving that small specialized models can outperform large models on OCR tasks.