[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116492":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},116492,"AksonOCR-Lite","Remtir\u002FAksonOCR-Lite","Remtir","Thai document OCR with a grapheme-cluster CTC recognizer. 81M params, runs on CPU: ~3x faster per page than 2B-param OCR VLMs on a GPU, and more accurate than VLMs on average.",null,"Python",64,9,55,1,0,6,3,46.6,"Apache License 2.0",false,"main",[],"2026-11-18 04:18:28","2026-11-22 15:32:35","\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002FAksonOCR-logo.svg\" alt=\"AksonOCR\" width=\"420\">\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">AksonOCR-Lite\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Faksonocr.com\u002Flite-demo\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%E2%96%B6%20Try%20the%20live%20demo-aksonocr.com%2Flite--demo-2563eb?style=for-the-badge\" alt=\"Try the live demo\" height=\"36\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FRemtir\u002FAksonOCR-Lite\u002Factions\u002Fworkflows\u002Fci.yml\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002FRemtir\u002FAksonOCR-Lite\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg\" alt=\"CI\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache--2.0-blue?style=flat-square\" alt=\"License: Apache-2.0\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white\" alt=\"Python 3.10+\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FONNX%20Runtime-CPU%20%7C%20GPU-005CED?style=flat-square&logo=onnx&logoColor=white\" alt=\"ONNX Runtime: CPU or GPU\">\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002FRemtir\u002FAksonOCR-Lite\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20weights-Remtir%2FAksonOCR--Lite-FFD21E?style=flat-square\" alt=\"Weights on Hugging Face\">\u003C\u002Fa>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flanguage-Thai%20%2B%20English-6b7079?style=flat-square\" alt=\"Thai + English\">\n  \u003Ca href=\"BENCHMARKS.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMDPBench--th-85.6%20with%20dewarp-2ea44f?style=flat-square\" alt=\"MDPBench-th 85.6 with dewarp\">\u003C\u002Fa>\n  \u003Ca href=\"BENCHMARKS.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FThaiOCRBench%20DP-0.640-2ea44f?style=flat-square\" alt=\"ThaiOCRBench Document parsing 0.640\">\u003C\u002Fa>\n  \u003Ca href=\"BENCHMARKS.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fspeed-1.5%20s%2Fpage%20on%20CPU-6b7079?style=flat-square\" alt=\"1.5 s per page on CPU\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fweights-330%20MB-6b7079?style=flat-square\" alt=\"330 MB of weights\">\n\u003C\u002Fp>\n\nFast, open-source **Thai document OCR** with a grapheme-cluster CTC recognizer. Turns PDFs and images into\nMarkdown, plain text or JSON with layout blocks, reading order, text-line boxes and tables. Runs on\n**ONNX Runtime**, on CPU or GPU, with no PyTorch or Paddle install.\n\n> [!TIP]\n> **[Try it in your browser →](https:\u002F\u002Faksonocr.com\u002Flite-demo)** Upload a page image or PDF (up to 7 MB) and see the\n> Markdown, layout and tables. No install.\n\n> **81M params, runs on CPU:** ~3× faster per page than 2B-param OCR VLMs on a GPU, and more accurate than VLMs\n> on average across MDPBench, ThaiOCRBench and SEA-DocBench ([benchmarks](BENCHMARKS.md)).\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002FRemtir\u002FAksonOCR-Lite\naksonocr invoice.pdf > invoice.md\n```\n\n\u003Csub>The PyPI package (`pip install aksonocr-lite`) is coming soon; until then, install from GitHub as above.\u003C\u002Fsub>\n\n- **Thai first:** the text recognizer is trained for Thai (with English), predicting whole grapheme clusters\n  so stacked vowels and tone marks come out in the right order.\n- **Document structure:** 25 layout classes (titles, paragraphs, tables, figures, headers\u002Ffooters, ...) and\n  reading order from PP-DocLayoutV3; tables become HTML with row\u002Fcolumn spans.\n- **Photos too:** page-orientation correction, upside-down line detection, and optional page dewarping.\n- **Light:** about 330 MB of weights by default (≈620 MB with dewarping), fetched from the Hugging Face Hub on first run.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fviz\u002Fdemo1.gif\" alt=\"Layout blocks and text lines on a Thai government letter\" width=\"32%\">\n  \u003Cimg src=\"assets\u002Fviz\u002Fsample2.gif\" alt=\"Layout blocks and text lines on a handwritten page photo\" width=\"32%\">\n  \u003Cimg src=\"assets\u002Fviz\u002Fsample1.gif\" alt=\"Layout blocks and text lines on a financial statement\" width=\"32%\">\n\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Csub>Layout blocks in reading order, table cells (TATR grid), then detected text lines. Made with \u003Ccode>tools\u002Fvisualize_gif.py\u003C\u002Fcode>.\u003C\u002Fsub>\u003C\u002Fp>\n\n## Benchmarks\n\n**MDPBench-th 85.6** with `--dewarp` (79.5 default) · **ThaiOCRBench DP 0.640** · **SEA-DocBench-th text NED 0.058**\n· **1.5 s per page on CPU only**.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fcharts\u002Faccuracy_light.png\" alt=\"Accuracy of AksonOCR-Lite vs 12 other Thai OCR systems: average of MDPBench-th, ThaiOCRBench Document parsing and SEA-DocBench-th\" width=\"100%\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fcharts\u002Fspeed_light.png\" alt=\"Speed of AksonOCR-Lite vs three VLMs, average over three benchmarks: seconds per page one at a time, pages per second batched\" width=\"100%\">\n\u003C\u002Fp>\n\nAverages over MDPBench-th, ThaiOCRBench Document parsing and SEA-DocBench-th.\n**[Full benchmark →](BENCHMARKS.md)** per-benchmark charts, default vs `--dewarp`, speed tables, text recognition\nonly.\n\n## Requirements\n\n| | |\n|---|---|\n| **Python** | 3.10 or newer (CI tests 3.10 and 3.13) |\n| **OS** | Linux, macOS (Apple Silicon). Windows is untested so far. |\n| **Hardware** | Any x86-64 or ARM64 CPU. No GPU needed; NVIDIA GPU optional (see [GPU](#gpu)). |\n| **RAM** | about 1.3 GB peak for one page, about 2.8 GB with `--dewarp` |\n| **Disk** | about 330 MB of model weights, plus 290 MB for `--dewarp`, in the Hugging Face cache (`~\u002F.cache\u002Fhuggingface`) |\n| **Network** | only on first run, to download the weights. Use [`AKSONOCR_WEIGHTS`](#offline--custom-weights) for fully offline machines. |\n\nNo PyTorch, Paddle or system packages are needed. `pip` installs everything else: `onnxruntime`, `numpy`,\n`opencv-python-headless`, `pillow`, `pypdfium2` (PDF rendering), `pyclipper`, `shapely` and `huggingface_hub`.\n\nFor the GPU build (`onnxruntime-gpu`): an NVIDIA driver with CUDA 12 and cuDNN 9, the versions current\n`onnxruntime-gpu` wheels are built against.\n\n## Usage\n\n### Command line\n\n```bash\naksonocr page.jpg                        # Markdown to stdout\naksonocr report.pdf --out out\u002F           # out\u002Freport.md (every page of the PDF)\naksonocr scan.png -f json -o out\u002F        # boxes, blocks, lines, confidences\naksonocr photo.jpg --dewarp              # flatten a photographed \u002F curled page\naksonocr doc.pdf --device cpu --dpi 200 --max-pages 10\n```\n\n### Python\n\n```python\nimport aksonocr_lite\n\nconv = aksonocr_lite.load()                 # device=\"auto\" | \"cpu\" | \"cuda\", dewarp=False, tables=True, ...\nfor page in conv.convert(\"report.pdf\"):     # path, bytes, PIL.Image or BGR numpy array\n    print(page.markdown)\n    for block in page.blocks:               # reading order\n        print(block.label, block.bbox, block.text or block.html)\n    for line in page.lines:\n        print(line.text, line.confidence, line.poly)\n\nlines = conv.ocr(bgr_image)                  # text lines only, no layout\n```\n\n`Page` fields: `markdown`, `text`, `blocks` (`label`, `bbox`, `score`, `order`, `text`, `html`, `line_ids`),\n`lines` (`text`, `confidence`, `bbox`, `poly`), `rotation`, `dewarped`, `width`, `height`, `timings`.\nAll coordinates are in the pixel space of the (rotated, dewarped) page image.\n\n### GPU\n\nThe default install runs on CPU, on Linux and macOS (Apple Silicon). For CUDA, swap ONNX Runtime for its GPU build:\n\n```bash\npip uninstall -y onnxruntime && pip install onnxruntime-gpu\n```\n\n`device=\"auto\"` then picks CUDA. Inputs have variable shapes, so the CPU path is often just as fast for\nsingle pages; the GPU pays off mostly with dewarping and large batches.\n\n### Offline \u002F custom weights\n\nSet `AKSONOCR_WEIGHTS=\u002Fpath\u002Fto\u002Fdir` to load models from a local folder instead of the Hub. It must contain\n`layout.onnx det.onnx doc_ori.onnx textline_ori.onnx rec.onnx rec_charset.json tatr.onnx`, plus\n`dewarp_mask.onnx dewarp_grid.onnx` for `--dewarp`.\n\n## How it works\n\n```\npage image ─┬─ (dewarp: MonkeyOCRv2 preprocessor)            optional\n            ├─ page orientation: PP-LCNet doc_ori             0\u002F90\u002F180\u002F270\n            ├─ layout + reading order: PP-DocLayoutV3        ┐\n            ├─ text lines: PP-OCRv6_medium_det (DB)           │ run on the same page\n            │    └─ line orientation (PP-LCNet textline_ori)  │\n            │    └─ recognition: AksonOCR Thai CTC (+180° re-read, keeps the more confident reading)\n            ├─ tables: re-detect text in the crop → TATR v1.1 grid → fill cells with OCR lines → HTML\n            └─ merge: each line → the layout block holding its centre (nearest block as fallback),\n                      blocks in reading order → Markdown\n```\n\n### Thai recognizer: grapheme-cluster CTC\n\nThai stacks vowels and tone marks on the consonant, so one glyph can be 2–3 code points (ผู้ = ผ + ู + ้).\nInstead of emitting them one by one, the recognizer predicts the **whole cluster as one token**.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fviz\u002Fcluster_tokens.gif\" alt=\"Step by step: the recognizer's real CTC output on a Thai line, spelled as character tokens (22 symbols, stacked marks as 2–3 symbols in one spot) and as cluster tokens (15 symbols, one per glyph column)\" width=\"100%\">\n\u003C\u002Fp>\n\u003Cp align=\"center\">\u003Csub>Real CTC output of the recognizer on a photographed line; made with \u003Ccode>tools\u002Fcluster_gif.py\u003C\u002Fcode>.\u003C\u002Fsub>\u003C\u002Fp>\n\n- **Correct order, always:** marks inside a cluster always come out in Unicode order, never swapped.\n- **No impossible output:** only real clusters are in the vocabulary (2,149 of 2,455 classes).\n- **Shorter sequence:** one token per glyph (15 vs 22 on the line above).\n- **Tiny and fast:** 1.5M parameters, 88.6% exact match at 8 ms per line on one CPU thread\n  ([comparison](BENCHMARKS.md#text-recognition-only)).\n\nDetails worth knowing:\n\n- Text in tables is read by the Thai recognizer, not by the table model: TATR only provides the grid.\n- The detector often boxes a lone Thai vowel or tone mark; such fragments are dropped before recognition.\n- Lines are batched only with lines of nearly the same width. Padding changes the recognizer's\n  attention and cost about 3 points of exact-match accuracy when widths were mixed freely.\n\n## Limitations\n\n- **Photographed pages are harder than digital ones.** On MDPBench-th the default pipeline scores 89.5 on digital\n  pages but 76.2 on photos (curl, shadow, glare, perspective). `--dewarp` brings photos to 84.3 at about twice the\n  weights and extra time per page; very dark, folded or blurred photos still lose text.\n- **Handwriting is weak.** The recognizer was trained for printed Thai and English; handwritten notes and\n  filled-in forms come out with many errors.\n- **No formula or picture understanding.** Math is read as plain text lines (no LaTeX). Figures and charts\n  become `\u003Cfigure>` blocks holding only the text printed in them, with no description of the picture.\n- **Dense multi-column layouts** such as newspapers often get the reading order or column split wrong.\n- **Thai and English only.** Other scripts and vertical text are not supported.\n\n## Models and licenses\n\n| Stage | Model | License |\n|---|---|---|\n| Layout + reading order | [PP-DocLayoutV3](https:\u002F\u002Fhuggingface.co\u002FPaddlePaddle\u002FPP-DocLayoutV3_onnx) | Apache-2.0 |\n| Text detection | [PP-OCRv6_medium_det](https:\u002F\u002Fhuggingface.co\u002FPaddlePaddle\u002FPP-OCRv6_medium_det_onnx) | Apache-2.0 |\n| Page \u002F line orientation | [PP-LCNet_x1_0_doc_ori](https:\u002F\u002Fhuggingface.co\u002FPaddlePaddle\u002FPP-LCNet_x1_0_doc_ori_onnx), [textline_ori](https:\u002F\u002Fhuggingface.co\u002FPaddlePaddle\u002FPP-LCNet_x1_0_textline_ori_onnx) | Apache-2.0 |\n| Text recognition | AksonOCR Thai recognizer (fine-tuned PP-OCRv6_tiny_rec), [model card](MODEL_CARD.md) | Apache-2.0 |\n| Table structure | [Table Transformer v1.1-all](https:\u002F\u002Fhuggingface.co\u002Fmicrosoft\u002Ftable-transformer-structure-recognition-v1.1-all) (Microsoft) | MIT |\n| Dewarping (optional) | [MonkeyOCRv2](https:\u002F\u002Fgithub.com\u002FYuliang-Liu\u002FMonkeyOCRv2) document preprocessor | Apache-2.0 |\n\nAll weights download from one Hugging Face repo, [Remtir\u002FAksonOCR-Lite](https:\u002F\u002Fhuggingface.co\u002FRemtir\u002FAksonOCR-Lite);\nthe PaddlePaddle models there are unmodified copies of the official ONNX exports linked above.\nThe code is Apache-2.0 ([LICENSE](LICENSE)); third-party attributions are in [NOTICE](NOTICE). Every model\nis permissively licensed, so AksonOCR-Lite can be used commercially. PDFs are rendered with pypdfium2\n(Apache-2.0\u002FBSD), not PyMuPDF (AGPL).\n\n## Development\n\n```bash\npip install -e .[dev]\npytest -m \"not e2e\"          # unit tests, no weights needed\npytest                       # + end-to-end test (downloads weights)\n```\n\n`tools\u002F` holds the scripts that produced the ONNX files (they need Paddle\u002FPyTorch and are not part of the\npackage): `export_tatr.py`, `export_dewarp.py`.\n\n## Acknowledgements\n\nAksonOCR-Lite stands on open work from many teams:\n\n- [PaddleOCR](https:\u002F\u002Fgithub.com\u002FPaddlePaddle\u002FPaddleOCR) (PaddlePaddle): PP-DocLayoutV3, PP-OCRv6 detection and\n  the tiny recognizer the Thai model was fine-tuned from, PP-LCNet orientation models, and the DB \u002F CTC\n  post-processing this code ports.\n- [Table Transformer](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftable-transformer) (Microsoft) for table structure.\n- [MonkeyOCRv2](https:\u002F\u002Fgithub.com\u002FYuliang-Liu\u002FMonkeyOCRv2) for the page dewarping preprocessor.\n- [ONNX Runtime](https:\u002F\u002Fonnxruntime.ai) and [pypdfium2](https:\u002F\u002Fgithub.com\u002Fpypdfium2-team\u002Fpypdfium2), which make\n  a framework-free install possible.\n- The benchmark authors: [MDPBench](https:\u002F\u002Fgithub.com\u002FYuliang-Liu\u002FMultimodalOCR) (with the OmniDocBench\n  evaluator), [ThaiOCRBench](https:\u002F\u002Fgithub.com\u002Fscb-10x\u002FThaiOCRBench) and\n  [SEA-Vision \u002F SEA-DocBench](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fxingranzhao\u002FSEA-Vision).\n\n## Citation\n\n```bibtex\n@software{aksonocr_lite,\n  author = {Jaknamon, Teetouch},\n  title  = {AksonOCR-Lite: Thai Document OCR with Grapheme-Cluster CTC Recognition},\n  version = {1.0.0},\n  year   = {2026},\n  url    = {https:\u002F\u002Fgithub.com\u002FRemtir\u002FAksonOCR-Lite}\n}\n```\n","AksonOCR-Lite 是一个专为泰语文档设计的轻量级开源OCR工具，支持PDF和图像输入，可输出带结构信息的Markdown、纯文本或JSON（含阅读顺序、文本行框、表格及版面块）。其核心采用基于图形单元簇（grapheme-cluster）的CTC识别器，针对泰语复杂的堆叠元音与声调标记优化，在CPU上单页处理仅需约1.5秒，速度约为20亿参数OCR多模态大模型的3倍，且在MDPBench-th等泰语基准测试中准确率更高。适用于政务、金融、教育等领域中需高效处理泰英双语扫描件、发票、表格等结构化文档的离线或资源受限场景。",2,"2026-11-24 04:53:40","CREATED_QUERY"]