Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,8 +20,13 @@ def ocr(image):
|
|
| 20 |
|
| 21 |
return output
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
iface = gr.Interface(fn=ocr,
|
| 24 |
-
inputs=gr.
|
| 25 |
outputs=["text", "image", "text", "text"])
|
| 26 |
|
|
|
|
| 27 |
iface.launch()
|
|
|
|
| 20 |
|
| 21 |
return output
|
| 22 |
|
| 23 |
+
def process_output(output):
|
| 24 |
+
output["step1_image"] = Image.fromarray(output["step1_image"])
|
| 25 |
+
return output
|
| 26 |
+
|
| 27 |
iface = gr.Interface(fn=ocr,
|
| 28 |
+
inputs=gr.Image(type="pil"),
|
| 29 |
outputs=["text", "image", "text", "text"])
|
| 30 |
|
| 31 |
+
iface.process_output = process_output
|
| 32 |
iface.launch()
|