Recursive AI
oneocrDocs

oneocr docs

Everything about OneOcr: getting started, the page model and its JSON, how a page is read, invoices, receipts, PDFs and LLM vision, training, the benchmarks, and the formats.

Reading a page

Orientation and deskewWhat the local reader does to a page image before it looks for text lines, so that scans fed in sideways, upside down or crooked are read like upright ones. Every step uses integers or the IEEE basic operations (+ − × ÷ √), so the result is the same on every machine, kernel…The page detectordbnet-lite-v1 is dbnet-lite-v0 with three optional changes. Everything else is as in v0: inputs, outputs, pre- and post-processing, layer types (convolution, 3x3 depthwise convolution, ReLU, nearest 2x upsampling, addition, channel mean, linear), tensor naming, the…CTC decodingInput: per-step class scores (logits, T steps of C classes, class 0 the CTC blank) from a recognizer, and the charset. Output: text and a confidence. Every mode gives the same bits on every CPU path, OS and degree of parallelism.Character language modelA file holds one n-gram model of words per script. The decoder (decoding.md) uses it to rank alternative readings of a text line. It is produced by training/charlm/build_charlm.py and read by CharLanguageModel. All integers are little-endian.Word frequency fileA file holds how often words occurred in running text. The recognizer's word segmentation (oneocr-page-v1.md, "Word segmentation") uses it to take back a space the network put inside a word. It is produced by training/wordlm/build_wordlm.py and read by WordFrequencyModel. All…Numeric rulesThe operation order that makes the library's output bit-identical across CPU paths (scalar, 128-bit vectors, AVX2 and AVX-512), operating systems and degrees of parallelism. A port that follows these rules reproduces the C# results exactly. All arithmetic is IEEE 754 binary32…