Downloads · 30 days
17
12% of all-time downloads
clzoro/Qwen3-VL-2B-LaTeX-OCR
Qwen3-VL-2B-LaTeX-OCR is a image-to-text model from clzoro. Use it when you need a caption or text from an image. The card lists the license as apache-2.0.
A 2B parameter vision-language model fine-tuned from Qwen/Qwen3-VL-2B-Instruct for LaTeX formula recognition from images. This model converts mathematical formula images into accurate LaTeX code.
Downloads · 30 days
17
12% of all-time downloads
All-time downloads
146
Public
Parameters
2.1B
29.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt25.5 GB · 86%
From the Hugging Face model README
A 2B parameter vision-language model fine-tuned from Qwen/Qwen3-VL-2B-Instruct for LaTeX formula recognition from images. This model converts mathematical formula images into accurate LaTeX code.
| Property | Value |
|---|---|
| Base Model | Qwen/Qwen3-VL-2B-Instruct |
| Model Type | Vision-Language Model (Image-to-Text) |
| Parameters | 2B |
| Language | English |
| License | Apache 2.0 |
| Developer | Kassadin88 |
Trained on the LaTeX-OCR dataset for mathematical formula image to LaTeX conversion. The dataset contains rendered LaTeX formulas paired with their source LaTeX code.
| Type | Description |
|---|---|
| Inline formulas | Simple expressions like $E = mc^2$ |
| Display equations | Centered equations with equation numbering |
| Matrices | Matrix and array environments |
| Multi-line expressions | Aligned, gathered, and cases environments |
| Complex formulas | Nested fractions, integrals, summations, and tensor notation |
from transformers import AutoModelForCausalLM, AutoProcessor
from PIL import Image
model_name = "Kassadin88/Qwen3-VL-2B-LaTeX-OCR"
model = AutoModelForCausalLM.from_pretrained(
model_name,
trust_remote_code=True,
torch_dtype="auto"
)
processor = AutoProcessor.from_pretrained(
model_name,
trust_remote_code=True
)
image = Image.open("formula.png")
messages = [
{"role": "user", "content": [
{"type": "image"},
{"type": "text", "text": "Transcribe the formula in the image to LaTeX."}
]}
]
inputs = processor.apply_chat_template(
messages,
images=[image],
return_tensors="pt"
)
outputs = model.generate(**inputs, max_new_tokens=512)
result = processor.decode(outputs[0], skip_special_tokens=True)
print(result)
vllm serve Kassadin88/Qwen3-VL-2B-LaTeX-OCR \
--port 8000 \
--max-model-len 4096 \
--trust-remote-code
messages = [
{"role": "user", "content": [
{"type": "image"},
{"type": "text", "text": "Convert this mathematical formula to LaTeX."}
]}
]
@misc{qwen3-vl-2b-latex-ocr,
author = {Kassadin88},
title = {Qwen3-VL-2B-LaTeX-OCR: A Fine-Tuned Vision-Language Model for LaTeX OCR},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/Kassadin88/Qwen3-VL-2B-LaTeX-OCR}
}
Note: This model is intended for research and educational purposes. Please use responsibly.