Spaces:
Runtime error
Runtime error
Download app.py from Sarath2002/Form_Understanding_using_LayoutLMV3: direct link, hf CLI and curl.
- Browser
- Download file 722 Bytes
-
https://huggingface.co/spaces/Sarath2002/Form_Understanding_using_LayoutLMV3/resolve/94302dfd8a75ddca93aca29c9d2a25de7eaf32c1/app.py
- Command line
-
hf download hf://spaces/Sarath2002/Form_Understanding_using_LayoutLMV3@94302dfd8a75ddca93aca29c9d2a25de7eaf32c1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Sarath2002/Form_Understanding_using_LayoutLMV3/resolve/94302dfd8a75ddca93aca29c9d2a25de7eaf32c1/app.py
722 Bytes
| 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) | |
| iface = gr.Interface( | |
| fn=OCR_processor, | |
| inputs=gr.inputs.Image(type="filepath", label="Upload an Image"), | |
| outputs=gr.outputs.Image(type="pil", label="Processed Image"), | |
| title="OCR Image Processor", | |
| description="Upload an image, and the app will process it using OCR_processor() function.", | |
| theme="huggingface", # You can use "default", "compact", or "huggingface" themes | |
| layout="vertical", | |
| live=True, | |
| ) | |
| if __name__ == "__main__": | |
| iface.launch() | |