Spaces:
Runtime error
Runtime error
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="upload", label="Upload an Image"), | |
outputs=gr.outputs.Image(type="numpy", label="Processed Image"), | |
title="OCR Image Processor", | |
description="Upload an image, and the app will process it using OCR_processor() function.", | |
theme="default", # You can use "default", "compact", or "huggingface" themes | |
layout="vertical", | |
live=True, | |
) | |
if __name__ == "__main__": | |
iface.launch() | |