Downloads · 30 days
0
jsaksrisuwan/larngear_antocr_weight
larngear_antocr_weight is a image-to-text model from jsaksrisuwan. Use it when you need a caption or text from an image. It is set up for pytorch. The card lists the license as apache-2.0.
Compact CRNN + CTC line recognizer for printed/typed Thai documents with Latin (English / European-accent) co-script. ~33 MB, 254-character charset. Reads one text-line crop → string. Tuned for clean documents (forms,…
Downloads · 30 days
0
Access
Public
Updated Jun 18, 2026
Repo size
33.3 MB
Likes
0
Public
Click a slice to open those files.
.pt33.3 MB · 100%
From the Hugging Face model README
Compact CRNN + CTC line recognizer for printed/typed Thai documents with Latin (English / European-accent) co-script. ~33 MB, 254-character charset. Reads one text-line crop → string. Tuned for clean documents (forms, government reports, financial statements, academic calendars/timetables).
This repo is artifacts only — no inference code. It pairs with the
recognizer in
larngear_AntOCR
(the _CRNN architecture + input normalization + CTC decode that these weights
are shape-locked to), used in production by larngear-docling.
| File | What |
|---|---|
best.pt | CRNN weights — plain state_dict, load with torch.load(weights_only=True) |
classes.json | charset, {"chars": [...]} — 254 chars (Thai + Latin + accents + digits + punctuation) |
The two are a versioned pair: len(chars) + 1 (the +1 is the CTC blank) is
the model's output dimension. A mismatched pair decodes to garbage — always pull
both from the same revision.
| Benchmark | CER |
|---|---|
| AntOCR real-PDF line bench (3502 lines) | ~4.3% |
larngear-docling control corpus — region-aligned text CER (~20 pages, born-digital Thai PDFs) | 2.34% |
Out of scope (not trained for it): scene text, handwriting.
from huggingface_hub import hf_hub_download
from antocr.core import CRNNLineRecognizer # from larngear_AntOCR
repo = "jsaksrisuwan/larngear_antocr_weight"
weights = hf_hub_download(repo, "best.pt", revision="main")
classes = hf_hub_download(repo, "classes.json", revision="main")
rec = CRNNLineRecognizer(weights=weights, classes=classes)
texts = rec.recognize_batch([line_crop0, line_crop1, ...]) # grayscale np.uint8 crops
Line segmentation (finding the line crops) is the consumer's job —
larngear-docling does layout detection + line-crop before calling this.
Pin revision to a tag or commit SHA for reproducible deploys.