Downloads · 30 days
5
3% of all-time downloads
Ntsako12/trocr_Tuned
trocr_Tuned is a image-to-text model from Ntsako12. Use it when you need a caption or text from an image. The card lists the license as apache-2.0.
This model is a fine-tuned version of fhswf/TrOCRMathhandwritten for recognizing handwritten mathematical expressions and converting them to LaTeX format.
Downloads · 30 days
5
3% of all-time downloads
All-time downloads
173
Public
Parameters
609M
4.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.4 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of fhswf/TrOCR_Math_handwritten for recognizing handwritten mathematical expressions and converting them to LaTeX format.
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
processor = TrOCRProcessor.from_pretrained("Ntsako12/TrOCR_Tuned")
model = VisionEncoderDecoderModel.from_pretrained("Ntsako12/TrOCR_Tuned")
image = Image.open("math_equation.jpg").convert("RGB")
pixel_values = processor(image, return_tensors="pt").pixel_values
generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_text) # Output: rac{1}{2} + rac{3}{4}
Training
Epochs: 10
Batch Size: 16
Learning Rate: 5e-5
Framework: PyTorch with Hugging Face Transformers
Limitations
Performance may vary with different handwriting styles
Complex nested expressions might be challenging
Requires clear, well-written mathematical expressions