Recursive AI
LibraryC#Available

oneocr

Local OCR and document understanding for .NET, in pure C# with small models of its own. Images and PDFs in; text, a page model with boxes and calibrated confidences, Markdown, or invoice and receipt fields out.

dotnet add package RecursiveAI.OneOcr

A quick look

Load the bundled models once, then read text, the whole page or an invoice’s fields. Nothing to download, and nothing leaves the machine. Invoice fields also need RecursiveAI.OneOcr.Models.Documents.

Getting started
Program.csC#
using OneImage;
using OneOcr;
using OneOcr.Documents;
using OneOcr.Models.Documents;
OcrEngine engine = OcrEngine.LoadBundled();
Image image = Image.Load("invoice.png");
string text = image.ToText(engine);
OcrPage page = image.Ocr(engine);
DocumentModels.Configure();
Invoice invoice = image.ExtractInvoice(engine);
Console.WriteLine(invoice.Total?.Value);
What it does

What it does

Local, managed, no setup

The recognizer, page detector and word models ship inside the package and run on the CPU. No native binaries, no tessdata, no network. Latin, Greek and Cyrillic in one model.

A page, not a string

Blocks, lines, words and characters with boxes, tables with spans, key–value pairs and reading order, saved as versioned oneocr.page JSON.

Confidence you can use

A word’s confidence is the calibrated probability that it is exactly right, so one threshold means the same thing on every page.

Invoices and receipts as fields

Typed fields with their EN 16931 business terms, each with the words and box it was read from. A local model tags words on the page, so it can’t invent a value.

LLM vision, held to the page

Opt-in providers over plain HttpClient. Every value the model returns is checked against the page’s words and marked grounded, derived or ungrounded.

Same bytes everywhere

Text, boxes and confidences are bit-identical on AVX-512, AVX2, 128-bit vectors and the scalar path, at every thread count. NativeAOT and trimming work.

How it’s checked

Measured against four engines, wins and losses

One run of the release gate on a sealed test set, against Tesseract 5.3.4, PaddleOCR, docTR and Apple Vision. OneOcr was the best engine measured on five of the ten gated categories and behind the best on five: synthetic screenshots, complex layout, real web screenshots, clean real PDFs and generated photos of US receipts. The tables, conditions and method are published in full.

The benchmark tables

The packages

Go further