Downloads · 30 days
0
karankulshrestha/formula_ocr
formula_ocr is a machine learning model from karankulshrestha. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model performs OCR on hand-written calculus formulas, extracting text with high accuracy
Downloads · 30 days
0
Access
Public
Updated Nov 6, 2025
Repo size
311 MB
Likes
1
Public
Click a slice to open those files.
.safetensors311 MB · 97%
From the Hugging Face model README
This model performs OCR on hand-written calculus formulas, extracting text with high accuracy
pip install unsloth transformers torch pillow
from unsloth import FastVisionModel
import torch
from transformers import AutoModel
import os
os.environ["UNSLOTH_WARN_UNINITIALIZED"] = '0'
# Load the model
model, tokenizer = FastVisionModel.from_pretrained(
"karankulshrestha/formula_ocr",
load_in_4bit = False,
auto_model = AutoModel,
trust_remote_code = True,
unsloth_force_compile = True,
use_gradient_checkpointing = "unsloth",
)
# Enable fast inference
FastVisionModel.for_inference(model)
# Run OCR on an image
result = model.infer(
tokenizer,
prompt="\nFree OCR.",
image_file="path/to/your/image.jpg",
output_path="./output",
base_size=1024,
image_size=640,
crop_mode=True,
save_results=True,
)
print("OCR Result:", result)

@misc{formula_ocr},
author = {Karan Kulshrestha},
title = {Hand-written OCR Model},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/karankulshrestha/formula_ocr}
}