Spaces:
Runtime error
Runtime error
Commit
•
68c8b0d
1
Parent(s):
cc6f2b9
Update app.py
Browse files
app.py
CHANGED
@@ -54,12 +54,10 @@ def inference(img, lang):
|
|
54 |
im = PIL.Image.open(img.name)
|
55 |
img_array = np.array(im)
|
56 |
img = draw_mask(img_array, bounds)
|
57 |
-
img = Image.fromarray(
|
58 |
lang = ""
|
59 |
-
im.save('box.jpb')
|
60 |
img.save('result.jpg')
|
61 |
-
|
62 |
-
return ['box.jpg', 'result.jpg', pd.DataFrame(bounds). iloc[: , 1:2]]
|
63 |
|
64 |
title = 'Manga Image Cleaner'
|
65 |
description = 'Image inpainting and text detection demo with the use of EasyOCR and CV2. To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to test the program.'
|
@@ -77,7 +75,7 @@ gr.Interface(
|
|
77 |
[gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default="korean", label='language')],
|
78 |
[gr.outputs.Image(type='file', label='Output'),
|
79 |
gr.outputs.Image(type='file', label='Output'),
|
80 |
-
gr.outputs.Dataframe()],
|
81 |
title=title,
|
82 |
description=description,
|
83 |
article=article,
|
|
|
54 |
im = PIL.Image.open(img.name)
|
55 |
img_array = np.array(im)
|
56 |
img = draw_mask(img_array, bounds)
|
57 |
+
img = Image.fromarray(img, 'RGB')
|
58 |
lang = ""
|
|
|
59 |
img.save('result.jpg')
|
60 |
+
return ['result.jpg', pd.DataFrame(bounds). iloc[: , 1:2]]
|
|
|
61 |
|
62 |
title = 'Manga Image Cleaner'
|
63 |
description = 'Image inpainting and text detection demo with the use of EasyOCR and CV2. To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to test the program.'
|
|
|
75 |
[gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default="korean", label='language')],
|
76 |
[gr.outputs.Image(type='file', label='Output'),
|
77 |
gr.outputs.Image(type='file', label='Output'),
|
78 |
+
gr.outputs.Dataframe(header=["TEXT"])],
|
79 |
title=title,
|
80 |
description=description,
|
81 |
article=article,
|