Spaces:
Runtime error
Runtime error
File size: 892 Bytes
3ff6f0b b074f0f 3ff6f0b 7ae82e4 3ff6f0b a5940a3 3ff6f0b a5940a3 f6ec5e1 6a3300b a5940a3 dfbebe4 94302df 3ff6f0b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | import gradio as gr
from PIL import Image
from support import processor
import os
os.system("pip install -r requirements.txt")
def OCR_processor(input_image):
##input_image = Image.open(input_image)
return processor(input_image)
examples =[['eg1.png'],['eg2.png'],['eg3.png']]
iface = gr.Interface(
fn=OCR_processor,
inputs=gr.inputs.Image(type="pil", label="Upload an Image"),
outputs=gr.outputs.Image(type="pil", label="Processed Image"),
title="Form understanding using Multimodal Transformers",
examples=examples,
description="Upload an image, and the app will process it using the LayoutLMV3 multimodal transformer. You can get all the OCR tags marked in the image as output.",
theme="huggingface", # You can use "default", "compact", or "huggingface" themes
layout="vertical",
live=True,
)
if __name__ == "__main__":
iface.launch()
|