MeronOCR-140M-Preview
An ultra-compact model for text, formula, and table recognition
2 min readupdated
MeronOCR-140M-Preview is a lightweight multilingual model (English and Russian) for parsing documents, converting mathematical formulas into LaTeX, and extracting tables into HTML. The architecture combines a SigLIP2 visual encoder, a spatial compressor, and a 12-layer language decoder. The model consumes less than 1 GB of VRAM, allowing it to run on low-end GPUs. It is useful for developers and researchers who need fast local OCR with formula support.
Key features
- Visual encoder: Uses SigLIP2-Base with dynamic patch allocation to handle images of various formats.
- Token compression: An optical compressor reduces the number of visual tokens by 4x to speed up processing.
- Formula recognition: Supports transcription of mathematical expressions into LaTeX format.
- Table export: Can structure data from documents into ready-to-use HTML code.
What you can do
- Recognize a document: Extract text and markup from document scans or receipts in document mode.
- Digitize formulas: Convert complex mathematical equations from images into LaTeX code.
- Export tables: Turn images of tables from documents into structured HTML.
Example
import torch
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForCausalLM, PreTrainedTokenizerFast
model_id = "Rizor1x/MeronOCR-140M-Preview"
tokenizer = PreTrainedTokenizerFast.from_pretrained(model_id)
processor = AutoImageProcessor.from_pretrained(model_id, max_num_patches=1024)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
).to("cuda" if torch.cuda.is_available() else "cpu").eval()
image = Image.open("document_or_formula.png").convert("RGB")
output = model.chat_ocr(
image=image,
processor=processor,
tokenizer=tokenizer,
task="formula",
max_new_tokens=512,
)
print("Transcription:\n", output)
Read more
Details• Parameters: 141M (141M)
• Hardware requirements: less than 1 GB VRAM
• Languages: English, Russian
• License: Apache 2.0










Comments