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.
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..
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
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.
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 tablesThe packages
- RecursiveAI.OneOcr
Local OCR, the page model and its JSON, local Markdown, and invoice, receipt and custom extraction. No networking code. Pixels through oneimage. 1.0.0.
- .Models
RecursiveAI.OneOcr.embeds the recognizer, page detector and word models, checked against their SHA-256 pins on every load. Installed with the core package. 1.0.0.Models - .Models.Documents
RecursiveAI.OneOcr.adds the invoice and receipt extraction model. 1.0.0.Models. Documents - .Pdf
RecursiveAI.OneOcr.reads PDF pages: text-layer words through onepdf, and OCR of the image regions the text doesn’t cover. 1.0.0.Pdf - .Llm
RecursiveAI.OneOcr.adds LLM vision: Anthropic, OpenAI, OpenAI-compatible servers, Gemini and Azure OpenAI, with grounding, cost caps and routing. The only package that uses the network. 1.0.0.Llm - .Training
RecursiveAI.OneOcr.fine-tunes the recognizer or a new extraction head on your own documents, on the CPU, deterministically, with a review queue. 1.0.0.Training - .Tool
RecursiveAI.OneOcr.is theTool oneocrcommand line:ocr,train,evalandreview. 1.0.0. - .NET
.NET 10. NativeAOT and trimming are supported. Every package shares one version. Code and model weights are MIT or Apache-2.0.