Tonic commited on
Commit
1c8b27f
Β·
unverified Β·
1 Parent(s): bc9bd2e

do it normally

Browse files
Files changed (1) hide show
  1. app.py +7 -4
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
- res, html_content = process_image(image, task, ocr_type, ocr_box, ocr_color)
118
- if html_content:
119
- return res, html_content
120
- return res, None
 
 
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)