/ Модель

Характеристики

Лицензия
Apache 2.0
Архитектура
aksonocr-lite · dense
Библиотека
onnx
Опубликована
16 ноя 2026

AksonOCR-Lite

Описание изображенийИзображение → текст8 профессий

AksonOCR-Lite — компактная система OCR для извлечения текста, таблиц и структуры печатных документов на тайском и английском языках из изображений и PDF.

28 374скачиваний за 30 дней17лайковвеса обновлены18 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

AksonOCR-Lite — лёгкая система OCR для тайских документов, разработанная Remtir. Она извлекает текст из изображений страниц и PDF, формируя Markdown, обычный текст или JSON с блоками разметки, порядком чтения, координатами строк и таблицами. Модель использует несколько компонентов ONNX, включая распознавание строк с CTC по целым графемным кластерам тайского письма; размер системы составляет около 81 млн параметров, а веса занимают примерно 330 МБ без коррекции деформации страницы. Она работает через ONNX Runtime на CPU или GPU и не требует PyTorch или Paddle.

Система рассчитана прежде всего на печатные документы на тайском языке и также распознаёт английский. Она определяет структуру страницы, текстовые строки и таблицы, корректирует ориентацию и поддерживает дополнительную коррекцию деформации. По данным карточки, типичная страница обрабатывается примерно за 1,5 секунды на CPU. Лицензия — Apache-2.0.

Качество ниже на фотографиях со складками, бликами, тенями или размытием; рукописный текст распознаётся с ошибками. Модель не интерпретирует изображения, диаграммы и формулы, а в плотных многоколоночных документах может неверно определить порядок чтения. Поддерживаются только тайский и английский языки.

Сценарии применения

  • распознавание тайского текста в PDF и сканах
  • извлечение текста и структуры из фотографий документов
  • преобразование тайских документов в Markdown или обычный текст
  • извлечение таблиц из документов с сохранением структуры
  • получение координат текстовых строк и блоков разметки страницы

Ограничения

Слабее распознаёт рукописный текст и фотографии с размытием, складками, бликами или тенями; не интерпретирует содержимое изображений, формулы и диаграммы. Плотная многоколоночная вёрстка может приводить к ошибкам в порядке чтения; другие языки и вертикальный текст не поддерживаются.

Для каких профессий подходит8

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

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

The PyPI package (pip install aksonocr-lite) is coming soon; until then, install from GitHub as above.

  • Thai first: the text recognizer is trained for Thai (with English), predicting whole grapheme clusters so stacked vowels and tone marks come out in the right order.
  • Document structure: 25 layout classes (titles, paragraphs, tables, figures, headers/footers, ...) and reading order from PP-DocLayoutV3; tables become HTML with row/column spans.
  • Photos too: page-orientation correction, upside-down line detection, and optional page dewarping.
  • Light: about 330 MB of weights by default (≈620 MB with dewarping), fetched from the Hugging Face Hub on first run.

Benchmarks

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.

Requirements

Python3.10 or newer (CI tests 3.10 and 3.13)
OSLinux, macOS (Apple Silicon). Windows is untested so far.
HardwareAny x86-64 or ARM64 CPU. No GPU needed; NVIDIA GPU optional (see GPU).
RAMabout 1.3 GB peak for one page, about 2.8 GB with --dewarp
Diskabout 330 MB of model weights, plus 290 MB for --dewarp, in the Hugging Face cache (~/.cache/huggingface)
Networkonly 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.

Usage

Command line

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

Python

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.

GPU

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.

Offline / custom weights

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.

How it works

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 recognizer: grapheme-cluster CTC

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.

  • Correct order, always: marks inside a cluster always come out in Unicode order, never swapped.
  • No impossible output: only real clusters are in the vocabulary (2,149 of 2,455 classes).
  • Shorter sequence: one token per glyph (15 vs 22 on the line above).
  • Tiny and fast: 1.5M parameters, 88.6% exact match at 8 ms per line on one CPU thread (comparison).

Details worth knowing:

  • Text in tables is read by the Thai recognizer, not by the table model: TATR only provides the grid.
  • The detector often boxes a lone Thai vowel or tone mark; such fragments are dropped before recognition.
  • Lines are batched only with lines of nearly the same width. Padding changes the recognizer's attention and cost about 3 points of exact-match accuracy when widths were mixed freely.

Limitations

  • Photographed pages are harder than digital ones. On MDPBench-th the default pipeline scores 89.5 on digital pages but 76.2 on photos (curl, shadow, glare, perspective). --dewarp brings photos to 84.3 at about twice the weights and extra time per page; very dark, folded or blurred photos still lose text.
  • Handwriting is weak. The recognizer was trained for printed Thai and English; handwritten notes and filled-in forms come out with many errors.
  • No formula or picture understanding. Math is read as plain text lines (no LaTeX). Figures and charts become <figure> blocks holding only the text printed in them, with no description of the picture.
  • Dense multi-column layouts such as newspapers often get the reading order or column split wrong.
  • Thai and English only. Other scripts and vertical text are not supported.

Models and licenses

StageModelLicense
Layout + reading orderPP-DocLayoutV3Apache-2.0
Text detectionPP-OCRv6_medium_detApache-2.0
Page / line orientationPP-LCNet_x1_0_doc_ori, textline_oriApache-2.0
Text recognitionAksonOCR Thai recognizer (fine-tuned PP-OCRv6_tiny_rec), model cardApache-2.0
Table structureTable Transformer v1.1-all (Microsoft)MIT
Dewarping (optional)MonkeyOCRv2 document preprocessorApache-2.0

All weights download from one Hugging Face repo, Remtir/AksonOCR-Lite; the PaddlePaddle models there are unmodified copies of the official ONNX exports linked above. The code is Apache-2.0 (LICENSE); third-party attributions are in NOTICE. Every model is permissively licensed, so AksonOCR-Lite can be used commercially. PDFs are rendered with pypdfium2 (Apache-2.0/BSD), not PyMuPDF (AGPL).

Files in this repository

FileWhat it isOriginLicense
rec.onnx, rec_charset.jsonThai + English text-line recognizer (ours, model card)fine-tuned from PaddlePaddle PP-OCRv6_tiny_recApache-2.0
layout.onnxlayout blocks + reading orderPaddlePaddle/PP-DocLayoutV3_onnx, unmodified copyApache-2.0
det.onnxtext-line detectionPaddlePaddle/PP-OCRv6_medium_det_onnx, unmodified copyApache-2.0
doc_ori.onnx, textline_ori.onnxpage / text-line orientationPP-LCNet_x1_0_doc_ori_onnx, PP-LCNet_x1_0_textline_ori_onnx, unmodified copiesApache-2.0
tatr.onnxtable structure (rows, columns, headers, spans)microsoft/table-transformer-structure-recognition-v1.1-all, convertedMIT
dewarp_mask.onnx, dewarp_grid.onnxpage segmentation + dewarping grid (optional)MonkeyOCRv2 document preprocessor, convertedApache-2.0
config.jsonpipeline manifest (components, source revisions)oursApache-2.0

The aksonocr-lite package downloads these on first use. The four PaddlePaddle files are byte-identical copies of the official inference.onnx exports, kept here so the whole pipeline loads from one repository.

Development

pip install -e .[dev]
pytest -m "not e2e"          # unit tests, no weights needed
pytest                       # + end-to-end test (downloads weights)

tools/ holds the scripts that produced the ONNX files (they need Paddle/PyTorch and are not part of the package): export_tatr.py, export_dewarp.py.

Acknowledgements

AksonOCR-Lite stands on open work from many teams:

Citation

@software{aksonocr_lite,
  author = {Jaknamon, Teetouch},
  title  = {AksonOCR-Lite: Thai Document OCR with Grapheme-Cluster CTC Recognition},
  version = {1.0.0},
  year   = {2026},
  url    = {https://github.com/Remtir/AksonOCR-Lite}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · onnx

Нельзя запустить

Модель выложена только в формате ONNX, рантайм загружает PyTorch-веса.

Ревизия весов
576fa7b

0 моделей