Spaces:
Running
on
Zero
Running
on
Zero
do it normally
Browse files
app.py
CHANGED
@@ -113,11 +113,14 @@ def update_inputs(task):
|
|
113 |
elif task == "Render Formatted OCR":
|
114 |
return [gr.update(visible=False)] * 3 + [gr.update(visible=True)]
|
115 |
|
|
|
116 |
def ocr_demo(image, task, ocr_type, ocr_box, ocr_color):
|
117 |
-
|
118 |
-
if
|
119 |
-
|
120 |
-
|
|
|
|
|
121 |
|
122 |
with gr.Blocks() as demo:
|
123 |
gr.Markdown(title)
|
|
|
113 |
elif task == "Render Formatted OCR":
|
114 |
return [gr.update(visible=False)] * 3 + [gr.update(visible=True)]
|
115 |
|
116 |
+
|
117 |
def ocr_demo(image, task, ocr_type, ocr_box, ocr_color):
|
118 |
+
result = process_image(image, task, ocr_type, ocr_box, ocr_color)
|
119 |
+
if isinstance(result, tuple) and len(result) == 2:
|
120 |
+
res, html_content = result
|
121 |
+
if html_content:
|
122 |
+
return res, html_content
|
123 |
+
return result, None
|
124 |
|
125 |
with gr.Blocks() as demo:
|
126 |
gr.Markdown(title)
|