Edit model card

Typst Equation OCR Model

A pretrained TrOCR model for Typst equation OCR tasks.

Usage

Using transformers

from PIL import Image
from transformers import TrOCRProcessor, VisionEncoderDecoderModel

processor = TrOCRProcessor.from_pretrained("paran3xus/typst_eq_ocr")
model = VisionEncoderDecoderModel.from_pretrained('paran3xus/typst_eq_ocr')

image_fps = [
    'testimg/1.png',
]
images = [Image.open(fp).convert('RGB') for fp in image_fps]
pixel_values = processor(images=images, return_tensors="pt").pixel_values
generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)
[print(i) for i in generated_text]

Using Typress Client with Web Frontend

Check: https://github.com/ParaN3xus/typress

Downloads last month
211
Safetensors
Model size
29.4M params
Tensor type
F32
·
Inference API
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Space using paran3xus/typress_ocr 1