Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -3,8 +3,8 @@ import gradio as gr
|
|
3 |
def wordsrch(img):
|
4 |
lang = ["en"]
|
5 |
#ocrimg = gr.Interface.load("spaces/PaddlePaddle/PaddleOCR")(img, lang)
|
6 |
-
ocrimg = gr.Interface.load("spaces/tomofi/EasyOCR")(img, lang)[0]
|
7 |
-
return ocrimg
|
8 |
|
9 |
#examples = [["wordsearch2.jpg","en"]]
|
10 |
examples = ["wordsearch2.jpg"]
|
@@ -13,6 +13,6 @@ iface = gr.Interface(fn=wordsrch,
|
|
13 |
# Please choose from: 'numpy', 'pil', 'filepath'.
|
14 |
inputs=gr.inputs.Image(type='filepath', label='Input'), #"en"],
|
15 |
#outputs=gr.outputs.Image(type='file', label='Output'),
|
16 |
-
outputs=gr.outputs.Image(type='file', label='Output'),
|
17 |
examples = examples)
|
18 |
iface.launch(debug=True, enable_queue=True)
|
|
|
3 |
def wordsrch(img):
|
4 |
lang = ["en"]
|
5 |
#ocrimg = gr.Interface.load("spaces/PaddlePaddle/PaddleOCR")(img, lang)
|
6 |
+
ocrimg, dframe = gr.Interface.load("spaces/tomofi/EasyOCR")(img, lang)[0]
|
7 |
+
return ocrimg , dframe
|
8 |
|
9 |
#examples = [["wordsearch2.jpg","en"]]
|
10 |
examples = ["wordsearch2.jpg"]
|
|
|
13 |
# Please choose from: 'numpy', 'pil', 'filepath'.
|
14 |
inputs=gr.inputs.Image(type='filepath', label='Input'), #"en"],
|
15 |
#outputs=gr.outputs.Image(type='file', label='Output'),
|
16 |
+
outputs=[gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe(headers=['text', 'confidence'])],
|
17 |
examples = examples)
|
18 |
iface.launch(debug=True, enable_queue=True)
|