Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,8 +42,14 @@ with gr.Blocks() as app:
|
|
| 42 |
raw_output = gr.Textbox(label="متن استخراج شده")
|
| 43 |
processed_output = gr.Textbox(label="متن پردازش شده")
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
process_btn.click(
|
| 46 |
-
fn=
|
| 47 |
inputs=image_input,
|
| 48 |
outputs=[raw_output, processed_output]
|
| 49 |
)
|
|
|
|
| 42 |
raw_output = gr.Textbox(label="متن استخراج شده")
|
| 43 |
processed_output = gr.Textbox(label="متن پردازش شده")
|
| 44 |
|
| 45 |
+
def process_image(img):
|
| 46 |
+
# Avoid running OCR twice
|
| 47 |
+
raw = run_ocr(img)
|
| 48 |
+
processed = postprocess_text(raw)
|
| 49 |
+
return raw, processed
|
| 50 |
+
|
| 51 |
process_btn.click(
|
| 52 |
+
fn=process_image,
|
| 53 |
inputs=image_input,
|
| 54 |
outputs=[raw_output, processed_output]
|
| 55 |
)
|