Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -144,7 +144,7 @@ def translate_image(im, language):
|
|
| 144 |
#Enable writing on image
|
| 145 |
image_editable = ImageDraw.Draw(new_image)
|
| 146 |
image_editable.multiline_text((10,10), txt,spacing=2, font=title_font, fill= (0, 0, 0)) #(237, 230, 211)) (0, 0, 0))
|
| 147 |
-
return new_image
|
| 148 |
|
| 149 |
|
| 150 |
title = "Translate English Text to Your Regional Language In Your Forwarded Images"
|
|
@@ -154,7 +154,7 @@ pipeline = keras_ocr.pipeline.Pipeline()
|
|
| 154 |
gr.Interface(
|
| 155 |
translate_image,
|
| 156 |
[gr.inputs.Image(type="filepath", label="Input"), gr.inputs.Radio(choices=['hindi','spanish','french','turkish','german','irish', 'arabic'], type="value", default='hindi', label='Choose A Language')],
|
| 157 |
-
gr.outputs.Image(type="pil", label="Output"),
|
| 158 |
title=title,
|
| 159 |
description=description,
|
| 160 |
article=article,
|
|
|
|
| 144 |
#Enable writing on image
|
| 145 |
image_editable = ImageDraw.Draw(new_image)
|
| 146 |
image_editable.multiline_text((10,10), txt,spacing=2, font=title_font, fill= (0, 0, 0)) #(237, 230, 211)) (0, 0, 0))
|
| 147 |
+
return new_image, txt, extracted_text
|
| 148 |
|
| 149 |
|
| 150 |
title = "Translate English Text to Your Regional Language In Your Forwarded Images"
|
|
|
|
| 154 |
gr.Interface(
|
| 155 |
translate_image,
|
| 156 |
[gr.inputs.Image(type="filepath", label="Input"), gr.inputs.Radio(choices=['hindi','spanish','french','turkish','german','irish', 'arabic'], type="value", default='hindi', label='Choose A Language')],
|
| 157 |
+
[gr.outputs.Image(type="pil", label="Output"),"text", "text"],
|
| 158 |
title=title,
|
| 159 |
description=description,
|
| 160 |
article=article,
|