Spaces:
Runtime error
Runtime error
3rd draft
Browse files
app.py
CHANGED
|
@@ -35,8 +35,7 @@ def do_process(img):
|
|
| 35 |
# img.save(path_output)
|
| 36 |
result = ocr(path_input, out_dir=path_img_output_folder, save_vis=True)
|
| 37 |
img_res = Image.open(path_output)
|
| 38 |
-
|
| 39 |
-
return img_res
|
| 40 |
|
| 41 |
|
| 42 |
input_im = gr.inputs.Image(
|
|
@@ -44,6 +43,7 @@ input_im = gr.inputs.Image(
|
|
| 44 |
)
|
| 45 |
|
| 46 |
output_img = gr.outputs.Image(label="Output of OCR", type="pil")
|
|
|
|
| 47 |
|
| 48 |
title = "Reading draught marks"
|
| 49 |
description = (
|
|
@@ -54,7 +54,7 @@ article = "<p style='text-align: center'><a href='https://github.com/mawady' tar
|
|
| 54 |
iface = gr.Interface(
|
| 55 |
fn=do_process,
|
| 56 |
inputs=[input_im],
|
| 57 |
-
outputs=[output_img],
|
| 58 |
live=False,
|
| 59 |
interpretation=None,
|
| 60 |
title=title,
|
|
|
|
| 35 |
# img.save(path_output)
|
| 36 |
result = ocr(path_input, out_dir=path_img_output_folder, save_vis=True)
|
| 37 |
img_res = Image.open(path_output)
|
| 38 |
+
return img_res, result["predictions"]
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
input_im = gr.inputs.Image(
|
|
|
|
| 43 |
)
|
| 44 |
|
| 45 |
output_img = gr.outputs.Image(label="Output of OCR", type="pil")
|
| 46 |
+
output_txt = gr.outputs.Textbox(type='str', label='predictions')
|
| 47 |
|
| 48 |
title = "Reading draught marks"
|
| 49 |
description = (
|
|
|
|
| 54 |
iface = gr.Interface(
|
| 55 |
fn=do_process,
|
| 56 |
inputs=[input_im],
|
| 57 |
+
outputs=[output_img, output_txt],
|
| 58 |
live=False,
|
| 59 |
interpretation=None,
|
| 60 |
title=title,
|