Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,27 +90,27 @@ with gr.Blocks() as demo:
|
|
| 90 |
)
|
| 91 |
|
| 92 |
with gr.Tab("OCR"):
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
)
|
| 108 |
-
|
| 109 |
-
ocr_submit_button.click(
|
| 110 |
-
ocr_image,
|
| 111 |
-
inputs=[image_input],
|
| 112 |
-
outputs=ocr_output,
|
| 113 |
-
)
|
| 114 |
|
| 115 |
# Launch the app
|
| 116 |
demo.launch()
|
|
|
|
| 90 |
)
|
| 91 |
|
| 92 |
with gr.Tab("OCR"):
|
| 93 |
+
with gr.Row():
|
| 94 |
+
with gr.Column():
|
| 95 |
+
image_input = gr.Image(
|
| 96 |
+
label="Upload Image",
|
| 97 |
+
type="filepath", # Corrected type
|
| 98 |
+
image_mode="RGB",
|
| 99 |
+
)
|
| 100 |
+
ocr_submit_button = gr.Button("Extract Text")
|
| 101 |
+
|
| 102 |
+
with gr.Column():
|
| 103 |
+
ocr_output = gr.Textbox(
|
| 104 |
+
label="Extracted Text",
|
| 105 |
+
lines=10,
|
| 106 |
+
interactive=False,
|
| 107 |
+
)
|
| 108 |
|
| 109 |
+
ocr_submit_button.click(
|
| 110 |
+
ocr_image,
|
| 111 |
+
inputs=[image_input],
|
| 112 |
+
outputs=ocr_output,
|
| 113 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
# Launch the app
|
| 116 |
demo.launch()
|