Downloads · 30 days
5
8% of all-time downloads
ajmaclin/prescription-donut-ocr
prescription-donut-ocr is a image-text-to-text model from ajmaclin. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Stage 2 ng YOLO+Donut prescription OCR pipeline.
Downloads · 30 days
5
8% of all-time downloads
All-time downloads
66
Public
Parameters
202M
48.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt32.3 GB · 65%
How the weights are stored.
F32202M · 100%
From the Hugging Face model README
Stage 2 ng YOLO+Donut prescription OCR pipeline.
from transformers import DonutProcessor, VisionEncoderDecoderModel
from huggingface_hub import hf_hub_download
from PIL import Image
processor = DonutProcessor.from_pretrained("ajmaclin/prescription-donut-ocr")
model = VisionEncoderDecoderModel.from_pretrained("ajmaclin/prescription-donut-ocr")
image = Image.open("prescription_crop.jpg")
pixel_values = processor(image, return_tensors="pt").pixel_values
outputs = model.generate(pixel_values, max_length=256)
result = processor.batch_decode(outputs, skip_special_tokens=True)[0]
print(result)