Model reference · open weights
AksonOCR-Lite is an open-weight language model from Remtir.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the Remtir/AksonOCR-Lite model card, 2026-11-20
What it is
| Released by | Remtir |
|---|---|
| Released | 2026-11-16 |
From the model card
Fast, open-source Thai document OCR with a grapheme-cluster CTC recognizer. Turns PDFs and images into Markdown, plain text or JSON with layout blocks, reading order, text-line boxes and tables. Runs on ONNX Runtime, on CPU or GPU, with no PyTorch or Paddle install.
Try it in your browser → Upload a page image or PDF (up to 7 MB) and see the Markdown, layout and tables. No install.
81M params, runs on CPU: ~3× faster per page than 2B-param OCR VLMs on a GPU, and more accurate than VLMs on average across MDPBench, ThaiOCRBench and SEA-DocBench (benchmarks).
pip install git+https://github.com/Remtir/AksonOCR-Lite
aksonocr invoice.pdf > invoice.md
MDPBench-th 85.6 with --dewarp (79.5 default) · ThaiOCRBench DP 0.640 · SEA-DocBench-th text NED 0.058
· 1.5 s per page on CPU only.
Averages over MDPBench-th, ThaiOCRBench Document parsing and SEA-DocBench-th.
Full benchmark → per-benchmark charts, default vs --dewarp, speed tables, text recognition
only.
| Python | 3.10 or newer (CI tests 3.10 and 3.13) |
| OS | Linux, macOS (Apple Silicon). Windows is untested so far. |
| Hardware | Any x86-64 or ARM64 CPU. No GPU needed; NVIDIA GPU optional (see GPU). |
| RAM | about 1.3 GB peak for one page, about 2.8 GB with --dewarp |
| Disk | about 330 MB of model weights, plus 290 MB for --dewarp, in the Hugging Face cache (~/.cache/huggingface) |
| Network | only on first run, to download the weights. Use AKSONOCR_WEIGHTS for fully offline machines. |
No PyTorch, Paddle or system packages are needed. pip installs everything else: onnxruntime, numpy,
opencv-python-headless, pillow, pypdfium2 (PDF rendering), pyclipper, shapely and huggingface_hub.
For the GPU build (onnxruntime-gpu): an NVIDIA driver with CUDA 12 and cuDNN 9, the versions current
onnxruntime-gpu wheels are built against.
aksonocr page.jpg # Markdown to stdout
aksonocr report.pdf --out out/ # out/report.md (every page of the PDF)
aksonocr scan.png -f json -o out/ # boxes, blocks, lines, confidences
aksonocr photo.jpg --dewarp # flatten a photographed / curled page
aksonocr doc.pdf --device cpu --dpi 200 --max-pages 10
import aksonocr_lite
conv = aksonocr_lite.load() # device="auto" | "cpu" | "cuda", dewarp=False, tables=True, ...
for page in conv.convert("report.pdf"): # path, bytes, PIL.Image or BGR numpy array
print(page.markdown)
for block in page.blocks: # reading order
print(block.label, block.bbox, block.text or block.html)
for line in page.lines:
print(line.text, line.confidence, line.poly)
lines = conv.ocr(bgr_image) # text lines only, no layout
Page fields: markdown, text, blocks (label, bbox, score, order, text, html, line_ids),
lines (text, confidence, bbox, poly), rotation, dewarped, width, height, timings.
All coordinates are in the pixel space of the (rotated, dewarped) page image.
The default install runs on CPU, on Linux and macOS (Apple Silicon). For CUDA, swap ONNX Runtime for its GPU build:
pip uninstall -y onnxruntime && pip install onnxruntime-gpu
device="auto" then picks CUDA. Inputs have variable shapes, so the CPU path is often just as fast for
single pages; the GPU pays off mostly with dewarping and large batches.
Set AKSONOCR_WEIGHTS=/path/to/dir to load models from a local folder instead of the Hub. It must contain
layout.onnx det.onnx doc_ori.onnx textline_ori.onnx rec.onnx rec_charset.json tatr.onnx, plus
dewarp_mask.onnx dewarp_grid.onnx for --dewarp.
page image ─┬─ (dewarp: MonkeyOCRv2 preprocessor) optional
├─ page orientation: PP-LCNet doc_ori 0/90/180/270
├─ layout + reading order: PP-DocLayoutV3 ┐
├─ text lines: PP-OCRv6_medium_det (DB) │ run on the same page
│ └─ line orientation (PP-LCNet textline_ori) │
│ └─ recognition: AksonOCR Thai CTC (+180° re-read, keeps the more confident reading)
├─ tables: re-detect text in the crop → TATR v1.1 grid → fill cells with OCR lines → HTML
└─ merge: each line → the layout block holding its centre (nearest block as fallback),
blocks in reading order → Markdown
Thai stacks vowels and tone marks on the consonant, so one glyph can be 2–3 code points (ผู้ = ผ + ู + ้). Instead of emitting them one by one, the recognizer predicts the whole cluster as one token.
Details worth knowing:
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.