File size: 794 Bytes
18c67b8
 
c38fd4a
 
0e0d5e8
4692985
 
18c67b8
715f449
 
18c67b8
 
39aa976
c38fd4a
0e0d5e8
f4098cf
18c67b8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr

def wordsrch(img):
    lang = "en"
    #ocrimg = gr.Interface.load("spaces/PaddlePaddle/PaddleOCR")(img, lang)
    ocrimg = gr.Interface.load("spaces/tomofi/EasyOCR")(img, lang)[0]
    return ocrimg #, dframe

#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(headers=['text', 'confidence'])],
                      examples = examples)
iface.launch(debug=True, enable_queue=True)