Spaces:
Runtime error
Runtime error
test
Browse files
app.py
CHANGED
|
@@ -35,14 +35,14 @@ 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 |
-
return img_res, result["predictions"]
|
| 39 |
|
| 40 |
|
| 41 |
input_im = gr.inputs.Image(
|
| 42 |
shape=None, image_mode="RGB", invert_colors=False, source="upload", type="pil"
|
| 43 |
)
|
| 44 |
|
| 45 |
-
output_img = gr.outputs.Image(label="Output of OCR", type="pil")
|
| 46 |
output_txt = gr.outputs.Textbox(type='text', label='predictions')
|
| 47 |
|
| 48 |
title = "Reading draught marks"
|
|
|
|
| 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"]["rec_texts"]
|
| 39 |
|
| 40 |
|
| 41 |
input_im = gr.inputs.Image(
|
| 42 |
shape=None, image_mode="RGB", invert_colors=False, source="upload", type="pil"
|
| 43 |
)
|
| 44 |
|
| 45 |
+
output_img = gr.outputs.Image(label="Output of OCR", type="pil").style(height=256)
|
| 46 |
output_txt = gr.outputs.Textbox(type='text', label='predictions')
|
| 47 |
|
| 48 |
title = "Reading draught marks"
|