anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Reads a document image with a small 270M-parameter model and returns the text, formulas as LaTeX or tables as HTML, including scans, receipts and handwriting.
Falcon OCR is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install "torch>=2.5" transformers pillow einops
Falcon OCR reads a picture of a document with a single 270M-parameter model that mixes image patches and text from the first layer. Given an image, it writes out ordinary text, formulas as LaTeX, or tables as HTML.
Most OCR systems chain a vision encoder to a separate text decoder. Falcon OCR uses one Transformer for both, and you switch tasks through a category setting rather than extra modules.
Developers who need document text, tables or formulas out of images, and who would rather call one small model than assemble a pipeline.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Finance and admin | Back-office teams | Turn receipts and forms into text | Run a scanned receipt through the plain category |
| Archives | Librarians and archivists | Digitize historical and scanned pages | Read a page from a book scan |
| Science and education | Researchers and teachers | Pull formulas out of papers and exam sheets as LaTeX | Use the formula category on a photographed equation |
| Software | Developers | Add OCR with one model call | Get a table back as HTML for a data pipeline |
People who want a finished desktop OCR app can skip it, since this is a Python model you call from code.
| Use case | Who | What they get back |
|---|---|---|
| Read a scanned page | Developers | The page text as one string |
| Extract a table | Data teams | The table as HTML |
| Extract a formula | Researchers | The formula as LaTeX |
You need Python and PyTorch 2.5 or newer, because the model uses FlexAttention.
pip install "torch>=2.5" transformers pillow einops
The first call can be slower, because torch.compile builds optimized kernels. To fetch the files alone, Hugging Face gives these two commands.
pip install -U huggingface_hub hf download tiiuae/Falcon-OCR
Load the model, open an image and call generate. Without a category it reads the page as plain output, and you can pick a category to choose the format.
import torch
from PIL import Image
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
"tiiuae/Falcon-OCR",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto",
)
image = Image.open("document.png")
texts = model.generate(image) # default category is "plain"
print(texts[0])texts = model.generate(image, category="text") # plain text texts = model.generate(image, category="formula") # LaTeX texts = model.generate(image, category="table") # HTML table
Further category names cover page parts such as headers, footers, titles, captions, footnotes and list items. The function returns a list with one string per image.
| Tool | What it does |
|---|---|
| model.generate | Reads one image or a list of images and returns one string per image |
| category="text" | Returns the text as plain text |
| category="formula" | Returns a formula as LaTeX |
| category="table" | Returns a table as HTML |
You open a photographed invoice with Image.open("document.png") and call model.generate(image, category="table"). You get back a list with one string, and that string holds the invoice table written as HTML.
Think of it as a reader for pictures of pages. You hand it an image, tell it whether you want text, a formula or a table, and it gives you the result as text. A good first try is the short script above on one clear scan.
Underneath, image patches and text tokens share one parameter space. Image tokens attend in both directions, and text tokens decode causally with the image in view. Version 1.5 was post-trained with GRPO, using edit distance for text, LaTeX validity for formulas and TEDS for tables, and zero reward for loops, omissions and over-long output.
The 1.5 update widened coverage to historical scans, handwriting, receipts, magazines, book scans, exam papers and hard tables, and aimed to cut invented text and repeated phrases.
Reads a document image with a small 270M-parameter model and returns the text, formulas as LaTeX or tables as HTML, including scans, receipts and handwriting.
Made by tiiuae on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: Falcon OCR reads a picture of a document with a single 270M-parameter model that mixes image patches and text from the first layer. Given an image, it writes out ordinary text, formulas as LaTeX, or tables as HTML.
Most OCR systems chain a vision encoder to a separate text decoder. Falcon OCR uses one Transformer for both, and you switch tasks through a category setting rather than extra modules.
Who it suits: Developers who need document text, tables or formulas out of images, and who would rather call one small model than assemble a pipeline.
Industry | Who uses it | How they use it | Example
Finance and admin | Back-office teams | Turn receipts and forms into text | Run a scanned receipt through the plain category
Archives | Librarians and archivists | Digitize historical and scanned pages | Read a page from a book scan
Science and education | Researchers and teachers | Pull formulas out of papers and exam sheets as LaTeX | Use the formula category on a photographed equation
Software | Developers | Add OCR with one model call | Get a table back as HTML for a data pipeline
People who want a finished desktop OCR app can skip it, since this is a Python model you call from code.
Where to use it:
Use case | Who | What they get back
Read a scanned page | Developers | The page text as one string
Extract a table | Data teams | The table as HTML
Extract a formula | Researchers | The formula as LaTeX
How to set it up: You need Python and PyTorch 2.5 or newer, because the model uses FlexAttention.
pip install "torch>=2.5" transformers pillow einops
The first call can be slower, because torch.compile builds optimized kernels. To fetch the files alone, Hugging Face gives these two commands.
pip install -U huggingface_hub
hf download tiiuae/Falcon-OCR
How to use it: Load the model, open an image and call generate. Without a category it reads the page as plain output, and you can pick a category to choose the format.
import torch
from PIL import Image
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
"tiiuae/Falcon-OCR",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto",
)
image = Image.open("document.png")
texts = model.generate(image) # default category is "plain"
print(texts[0])
texts = model.generate(image, category="text") # plain text
texts = model.generate(image, category="formula") # LaTeX
texts = model.generate(image, category="table") # HTML table
Further category names cover page parts such as headers, footers, titles, captions, footnotes and list items. The function returns a list with one string per image.
Tool | What it does
model.generate | Reads one image or a list of images and returns one string per image
category="text" | Returns the text as plain text
category="formula" | Returns a formula as LaTeX
category="table" | Returns a table as HTML
Example: You open a photographed invoice with Image.open("document.png") and call model.generate(image, category="table"). You get back a list with one string, and that string holds the invoice table written as HTML.
For newcomers and experts: Think of it as a reader for pictures of pages. You hand it an image, tell it whether you want text, a formula or a table, and it gives you the result as text. A good first try is the short script above on one clear scan.
Underneath, image patches and text tokens share one parameter space. Image tokens attend in both directions, and text tokens decode causally with the image in view. Version 1.5 was post-trained with GRPO, using edit distance for text, LaTeX validity for formulas and TEDS for tables, and zero reward for loops, omissions and over-long output.
Open the document image
Pick a category such as table
Call model.generate
Read one output string per image
Good to know: The 1.5 update widened coverage to historical scans, handwriting, receipts, magazines, book scans, exam papers and hard tables, and aimed to cut invented text and repeated phrases.
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download tiiuae/Falcon-OCR
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 6 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| Falcon OCR This page | 3,667 | 178 | 270M | apache-2.0 | |
| LightOnOCR-3-4BShares document-understanding · vision-language · transformers | 15,491 | 143 | 4.5B | apache-2.0 | |
| LightOnOCR-3-0.8BShares document-understanding · vision-language · transformers | 13,965 | 99 | 853M | apache-2.0 | |
| Xiaomi-OCR-0Shares document-understanding · transformers · safetensors | 29,537 | 319 | 873M | apache-2.0 | |
| MiMo-V2.6-Flash-RLShares vision-language · text-generation · transformers | 64,057 | 594 | 311B | mit | |
| MiMo-V2.6-Pro-RLShares vision-language · text-generation · transformers | 24,207 | 818 | 1T | mit |
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.