/ Модель

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

Лицензия
Apache 2.0
Опубликована
24 ноя 2026

KaoOCR-General-1.0a

Описание изображенийИзображение → текст6 профессий
25скачиваний за 30 дней0лайковвеса обновлены24 ноя 2026

Описание модели

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

Компактный OCR-конвейер для распознавания тайского и английского текста на изображениях с запуском на CPU.

KAO-OCR General 1.0a — разработанная автором README модель для распознавания тайского и английского текста на сканах и фотографиях. Это OCR-конвейер на ONNX Runtime, рассчитанный на работу на CPU: он обнаруживает строки, выравнивает и обрезает их, распознаёт текст небольшим CTC-распознавателем и объединяет результат в порядке чтения. Распознаватель содержит около 0,6 млн параметров; модель принимает изображения и выдаёт распознанный текст.

В версии 1.0a дообучен только распознаватель строк на тайском рукописном тексте; остальные компоненты конвейера оставлены без изменений. В README приведены результаты собственной оценки автора: они показывают улучшение распознавания рукописных строк, но также указывают, что качество на рукописном тексте остаётся ограниченным. Указанные метрики получены на небольшой выборке и не являются официальными результатами бенчмарка.

Модель предназначена для OCR тайских и английских документов, включая печатный и рукописный текст, однако качество распознавания рукописи может быть низким. Она не выполняет разбор таблиц, макетов или диаграмм и не формирует Markdown. Это альфа-версия; автор рекомендует проверять её на собственных данных. Лицензия — Apache-2.0.

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

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

Ограничения

Распознавание тайского рукописного текста остаётся сложным, а пропущенные детектором строки не распознаются. Модель не разбирает таблицы и макеты; оценки в README получены на небольшой выборке собственными скриптами автора.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

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

Открыть на Hugging Face

release runtime lang license

Thai + English OCR that doesn't need a GPU. A ~0.6M-parameter CTC line recogniser, nudged toward handwriting, with the receipts to prove (and bound) it.


$ whoami

KAO-OCR General is an ONNX, CPU-first OCR engine for Thai and English. It finds text lines, crops them, reads each crop with a tiny CTC recogniser, and stitches the result back together in reading order. No GPU, no serving stack, no gigabyte checkpoints: pip install five small packages and go.

Release 1.0a changes exactly one thing: the line recogniser has been gently fine-tuned on Thai handwriting. Everything else in the pipeline is left exactly as it was.

RuntimeONNX Runtime, CPUExecutionProvider
RecogniserCTC, ~0.6M parameters, 530 output classes (blank + 528 glyphs + space)
Input3 × 48 × W tensor (BGR, scaled to [-1, 1]), dynamic width
Decodinggreedy CTC
Changed in 1.0arec.onnx, pytorch/rec_weights.pt
Untoucheddetector (det.onnx), second recogniser (rec2.onnx), runtime/, LICENSE, NOTICE
page ──► det.onnx ──► line crops ──► rec.onnx (CTC) ──► reading order ──► text
                                          ▲
                                 the only weights touched in 1.0a

The runtime also handles orientation, deskew and reading order, so you can feed it ordinary scans and photos.

$ pip install and run

pip install -r requirements.txt

python inference.py page.png                 # text to stdout
python inference.py scans/ -o out/           # a whole folder -> out/<name>.txt
python inference.py page.png --json          # full result (lines, boxes, ...) as JSON

Or from Python:

from runtime.line_engine import LineOCR       # run from inside this repo folder

ocr = LineOCR(".", threads=1)
result = ocr.read("page.png")                  # path, bytes, numpy array or PIL image
print(result["text"])                          # full text in reading order

For batch jobs, N processes with 1 thread each is usually the better trade than 1 process with N threads.

Numbers

ThaiOCRBench, OCR tasks

Metric: NLS = 1 − normalised edit distance, 0–100, higher is better. 30 pages sampled per task type.

Task typeNLS
Full-page OCR70.8
Text recognition53.1
Handwritten content extraction18.4
Fine-grained text recognition15.4
Mean over the four OCR tasks39.4

Read this table with the right amount of salt:

  • The scorers are mine, not the benchmark authors' official scripts, and the pages are a sample (n = 30 per task). Don't line these numbers up against anyone's leaderboard.
  • Parsing tasks (tables, charts, document parsing) are n/a on purpose: General is an OCR-only engine and writes no Markdown.
  • There is no baseline column. The baseline run did not complete cleanly in my harness, so I make no before/after claim on this benchmark. The A/B I can stand behind is the held-out validation below.
  • Handwriting is the hard mode, and the table says so.

Held-out validation (recogniser only, greedy CTC)

Sentence-disjoint split: no sentence in validation appears in training.

CER, lower is betterbeforeafter (shipped)relative
Handwriting lines0.92000.8036−12.7%
Printed lines (rendered, synthetic)0.04360.0290−33.5%

"Before" is the recogniser this work started from. The honest read: a 12.7% relative CER reduction on handwriting is real movement, but a CER of 0.80 means handwriting is far from solved for a 0.6M-parameter model. The printed number is measured on lines rendered with the same family of Thai fonts as the training replay, so treat it as "printed text did not regress", not as a real-world printed-text claim.

How it was made

A small, careful fine-tune. The goal was to teach handwriting without making printed text worse.

  1. Data. Two public Thai handwriting corpora of line crops, pooled. Split by an MD5 hash of the normalised sentence, so a sentence written by several people (or present in both corpora) can never land in train and validation at once. 2% validation, 3% test, the rest train.
  2. Light touch. CTC fine-tuning of the recogniser only.
  3. Replay. About 25% of every training batch is printed text: the training sentences re-rendered with Thai fonts (random font, size, ink, background, blur), so the model keeps seeing the kind of text it already read well.
  4. Weight-space blend (WiSE-FT). w = (1 − α)·w_original + α·w_finetuned. α is not guessed: I sweep α ∈ {0.3, 0.5, 0.7, 1.0} on validation and take the best handwriting CER among the α values whose printed CER stays within 1.05 × baseline + 0.005. The pure fine-tune qualified, so α = 1.00 shipped.
  5. Verified export. Two gates. Before training, a PyTorch re-implementation must reproduce the shipped rec.onnx to within 5e-3 max abs difference, or training refuses to start. After training, the exported ONNX is checked against PyTorch on dynamic batch and width shapes: max |torch − onnx| = 1.2e-05.
Hyper-parameterValue
OptimiserAdamW, β = (0.9, 0.98), weight decay 0.01
LR schedule1e-4 peak, 100 warm-up steps, cosine to a 2% floor
Batch / clip64 / grad-norm 5.0
Epochs≤ 5, early stopping with patience 3
Checkpoint picklowest handwriting CER + 0.5 × printed CER on validation
Max line width1600 px (height fixed at 48)
Augmentationbrightness, contrast, blur, ±15% horizontal stretch, ±2° rotation, padding
Precisionbf16 autocast on GPU
Seed42

Limitations

  • Only the line recogniser was fine-tuned. If the detector misses a handwritten line, the recogniser never gets to see it.
  • Handwriting remains much harder than print for a model this small. Expect real gains, not magic.
  • Fine-tuned on single lines, not on page layouts; layout behaviour is whatever the untouched parts of the pipeline do.
  • OCR only: no tables, no Markdown.
  • Benchmark numbers come from my own sampled run and scorers.
  • It is an alpha. Test on your own data before you trust it.

Disclaimer & Credit

A side-project, honestly. I made this for fun. I'm not an OCR guy; I just wanted to add one more option to the Thai OCR toolbox. It's for my own use, I'm not trying to compete with anyone, and it comes with the usual alpha-software caveats: no warranty, check it on your own data.

Credit where it's due. KAO-OCR General is a fine-tune of iapp/OpenThai2.1-OCR-Text-20261118 (tag v2.1.4). I changed rec.onnx and pytorch/rec_weights.pt; everything else, including the LICENSE and NOTICE files, is theirs and is kept as shipped. Their original model card, which also documents the full runtime API (lines, boxes, confidence), is preserved as OPENTHAI_ORIGINAL_README.md.

Thank you 💛

  • iApp Technology, for building and openly releasing a genuinely good Thai OCR to start from.
  • The Typhoon team, for the great Thai OCR work and for ThaiOCRBench, which I used for evaluation.

Thanks for making good Thai models in the open. Without you two, this repo would just be an empty folder; any mistakes are mine.

License

Apache-2.0, same as the model it was fine-tuned from; see LICENSE and NOTICE (upstream notices, including third-party OCR components, are preserved there). The training data comes from two public Thai handwriting corpora, iapp/thai_handwriting_dataset and sivakorn-su/thai-handwriting-textdisjoint-v1, which carry their own terms: check them before commercial use.

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

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

GPU в ailist

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

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

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

Ревизия весов
ebb3f19

0 моделей