receipt-parser / app.py
laverdes's picture
fix: delete commented text
1d1c112
raw
history blame
469 Bytes
import torch
from PIL import Image
from transformers import VisionEncoderDecoderModel, VisionEncoderDecoderConfig # , DonutProcessor
def demo_process(input_img):
global pretrained_model, task_prompt, task_name
# input_img = Image.fromarray(input_img)
output = pretrained_model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
return output
task_prompt = f"<s>"
st.text('This model is trained with receipt images -> SROIE dataset.')