Open weights
OpenThai 2.2 OCR Text
An open Thai and English OCR model small enough to run on a CPU.
- Parameters2.02million
- LicenceApache-2.0
- Printed text, 12 sets88.2score
- One CPU worker0.39s a page
Download the weightsWhat is new in 2.2
Version 2.2.1, released 27 November 2026 by iApp Technology as open weights on Hugging Face: a free download. Versions 2.1.4 and 2.0 stay available under the tags v2.1.4 and v2.0.0.
What it does
- Reads printed Thai and EnglishReturns the page's text in reading order, with a box and a confidence for every line. It does not write tables or Markdown; for those, use OpenThai 2.2 OCR Markdown.
- Runs on a CPU0.39 seconds a page, one page at a time, and about 450 MB of memory per worker. With one worker per core, 8 CPU cores read about 57,000 pages an hour. No GPU.
- Reads old printTone marks that float above the line in old letterpress books are put back on their line, and the old-style ๙ of typewriters and letterpress is no longer read as ๕ as often.
- Handles real pagesTurns sideways and upside-down pages upright, deskews, reads two- and three-column pages column by column while keeping tables and lists in row order, and handles light-on-dark and coloured text.
- SmallFour ONNX files, about 8 MB in all: a text-line detector, a Thai line recognizer, a second recognizer for loopless fonts and a ๙ classifier.
What is new in 2.2
- 2.2.1: the old-style ๙ is read as ๕ far less often (typewriters and old letterpress). On 918 unseen old pages, ๙ read as ๕ fell from 19 to 6. A small classifier can only change ๕ to ๙, and nothing else moved on the benchmark.
- 2.2.0: optional flattening of phone photos (off by default; scans and PDFs are left alone). On 200 simulated phone photos, accuracy rose from 86.7 to 90.5.
Version 2.1 brought the tone marks of old books, loopless fonts and multi-column pages: what is new in 2.1.
Measured
Both engines read the same pages and were scored the same way: character accuracy, 100 × (1 − character error rate), higher is better, a page an engine fails on counting as empty. Typhoon OCR V2 0.8B was run as its model card says.
| This model, 2.2 | Typhoon OCR V2 0.8B | |
|---|---|---|
| Average, 12 printed Thai and English sets | 88.2 | 85.1 |
| Administrative Court judgments | 97.0 | 95.6 |
| Royal Gazette | 97.8 | 96.0 |
| Parliament budget documents | 99.6 | 85.9 |
| Old books (Thai Wikisource) | 78.8 | 76.3 |
| OCR104 Thai and English crops | 87.9 | 82.1 |
| ThaiOCRBench full pages | 83.8 | 86.1 |
| Handwriting, not a target | 10.3 | 69.8 |
| Receipts | 68.3 | 77.8 |
| Seconds a page † | 0.39 on a CPU | 1.71 on an H100 |
In short: ahead of Typhoon OCR V2 0.8B on the 12-set average by 3.1 points, [+1.4, +4.9] (paired 95% interval), on a CPU. Typhoon OCR V2 2B averages 89.51 on the same sets and needs a GPU. The GPU models read handwriting, receipts and scene text better; for whole pages with tables, OpenThai 2.2 OCR Markdown averages 90.55 on the same 12 sets.
† One page at a time, not on the same pages (this model: 24 printed pages on an Intel Xeon CPU; Typhoon OCR V2 0.8B: Thai document pages on an H100 with its EAGLE-3 head, 27 November 2026), so read them as a rough guide, not a ratio. The sets and the method are in the model card.
Run it
pip install openvino opencv-python-headless pyclipper numpy huggingface_hub # or onnxruntime in place of openvino
from huggingface_hub import snapshot_download
snapshot_download("iapp/OpenThai2.2-OCR-Text-20261127", local_dir="OpenThai2.2-OCR-Text")
import sys; sys.path.insert(0, "OpenThai2.2-OCR-Text")
from runtime.line_engine import LineOCR
ocr = LineOCR("OpenThai2.2-OCR-Text", threads=1)
r = ocr.read("page.png") # a path, bytes, a BGR array or a PIL image
print(r["text"]) # lines in reading order, columns one after another
r["lines"] # [{"text", "confidence", "row", "box"}], boxes in the input image's coordinates
For throughput, run one worker process per core with threads=1; threads in one process stop scaling at about two cores. For phone photos, pip install onnxruntime, download the flattening model with hf download PaddlePaddle/UVDoc_onnx inference.onnx --local-dir OpenThai2.2-OCR-Text/dewarp, and pass LineOCR(..., pre={"dewarp": True}); r["dewarp"] reports what was done.
The download always gives the latest version. To keep a version, pin it with revision="v2.2.1" in snapshot_download (or --revision v2.2.1); v2.1.4 gives 2.1 and v2.0.0 gives 2.0. The earlier names iapp/OpenThai2.0-OCR-Text and iapp/OpenThai2.1-OCR-Text-20261118 redirect to this repository, so existing links and code keep working.
A step-by-step guide for Windows, Mac and Linux, written for 2.0 and still valid with this repository's name: How to run OpenThai OCR on your own computer. The 2.0 launch post: OpenThai 2.0 OCR Text. Both OpenThai OCR models side by side: OpenThai OCR.
Prefer a hosted service? The Thai Document OCR API is built on this model and runs version 2.2: 0.049 IC a page for text, and 0.15 IC a page for layout JSON or a Word, PowerPoint, Excel or searchable PDF file.
Limits
- Printed text only. Handwriting, receipts photographed at an angle and scene text read poorly; for those, use a vision-language model such as OpenThai 2.2 OCR Markdown.
- No tables or Markdown: use OpenThai 2.2 OCR Markdown for those.
- A ๙ the detector or recognizer loses is not recovered by the classifier.
- Decorative display fonts: short labels in heavily stylised fonts can be misread, and loopless fonts can still swap one Thai letter for another.
- Small text on large screenshots can be missed.
- Stamps and seals come out as text, since they are text on the page.
- The quoted CPU speed needs AMX (Intel Sapphire Rapids or later), where it runs in bfloat16; other CPUs run it in float32, more slowly.
Training
The recognizer was fine-tuned on 410,270 real text lines: 261,877 lines from Administrative Court scans, labelled with the court's own text; 41,101 lines from the Thai parliament's budget PDFs, kept only where the text layer and the recognizer agree; and 107,292 lines from Wikisource old books. Synthetic Thai and English lines were rendered from 85 open-licence fonts; the second recognizer adds loopless fonts. No personal-data sets were used, and every benchmark document was left out.
Licence
Apache-2.0. The detector is PaddlePaddle's PP-OCRv6-tiny as shipped, and the recognizers were fine-tuned from PP-OCRv6-tiny's with a new Thai output layer; both are Apache-2.0, and the notices are in the repository.
From OpenThai (formerly OpenThaiGPT). Developed by iApp, launched with AIEAT. Trained on NVIDIA H100 GPUs provided by Siam AI Corporation.