ysharma's picture
ysharma HF staff
1
ed85e4b
raw
history blame
848 Bytes
import gradio as gr
def wordsrch(img):
lang = ["en"]
#ocrimg = gr.Interface.load("spaces/PaddlePaddle/PaddleOCR")(img, lang)
ocrimg, dframe = gr.Interface.load("spaces/tomofi/EasyOCR")(img, lang)
print(dframe)
return ocrimg
#examples = [["wordsearch2.jpg","en"]]
examples = ["wordsearch2.jpg"]
iface = gr.Interface(fn=wordsrch,
# Please choose from: 'numpy', 'pil', 'filepath'.
inputs=gr.inputs.Image(type='filepath', label='Input'), #"en"],
#outputs=gr.outputs.Image(type='file', label='Output'),
outputs=gr.outputs.Image(type='file', label='Output'), #gr.outputs.Dataframe(type="array", headers=['text' , 'confidence'])],
examples = examples)
iface.launch(debug=True, enable_queue=True)