indra-ocr (mixed fp16, ONNX) for onnxruntime-web

A size-reduced derivative of datalab-to/indra-ocr (revision bd02167fdf2005a19962cc15188f8496a2c87d3b), made for in-browser use with onnxruntime-web. The model architecture and training are unchanged; only the numeric storage of some files differs. File names match the base repo, so it is a drop-in replacement for the det.onnx, rec*.onnx, ... set.

What changed

files change
orient, script, rec, rec_world, rec_cjk, rec_rtl, mathcls, math_enc, math_dec_init, math_dec_step (.onnx) weights and compute in float16 (onnxconverter-common 1.16.0, keep_io_types=True: inputs and outputs stay float32; Cast-to-float nodes were moved to float16 to keep the graph type-consistent)
order.onnx weights stored as float16 with a Cast back to float32; compute is float32
det.onnx unchanged (float32). fp16 moves detection boxes enough to change line segmentation on one test page
lm.npz, lm_world.npz, lm_cjk.npz v* and hb* arrays stored as float16 (keys k*/hk* untouched, still uint64). Loaders must widen to float32/64
meta.json, math_meta.json, LICENSE unchanged

Total size of the Thai+English default set (det, orient, script, rec, rec_world, order, lm, lm_world, meta): 42.1 MB -> 26.3 MB.

Measured quality (vs. the fp32 base model, reference Python pipeline)

On 26 synthetic and real test inputs, 144 page runs (ocr mode, math off and on; PDFs also auto): character error rate change vs. the base model's own output 0.004 percentage points (2 edits in 46,088 characters), 99.9% of lines identical, block (layout) labels identical on all 144 page runs; Thai pages: no change at all. This is a regression check against the base model's output, not a benchmark against ground truth. The test set is small and synthetic; expect small differences in individual low-confidence lines.

Usage

Use exactly like the base repo: fetch the files over HTTPS and create onnxruntime-web sessions (wasm or webgpu execution provider). The files were verified to load and run with onnxruntime-web 1.30.0 (wasm EP) and onnxruntime 1.31.0 (CPU). Language-model .npz files need a loader that reads <f2 arrays (the Python reference loader does).

License and attribution

Derived from datalab-to/indra-ocr and distributed under the same terms: the AI Pubs Open RAIL-M License (Modified), see LICENSE (copied unchanged from the base repository). Use restrictions of that license pass to this derivative. All credit for the model goes to Datalab.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for CharlZKP/indra-ocr-fp16

Quantized
(6)
this model