xiaoyao9184 commited on
Commit
7c8919c
·
verified ·
1 Parent(s): a525ab7

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (1) hide show
  1. gradio_app.py +2 -2
gradio_app.py CHANGED
@@ -72,12 +72,12 @@ def inline_detection(img) -> (Image.Image, TextDetectionResult):
72
  det_img = draw_polys_on_image(inline_polygons, img.copy(), color='blue')
73
  return det_img, text_pred, inline_pred
74
 
75
- # just copy from streamlit_app.py `name 'inline_pred' is not defined`
76
  def text_detection(img) -> (Image.Image, TextDetectionResult):
77
  text_pred = predictors["detection"]([img])[0]
78
  text_polygons = [p.polygon for p in text_pred.bboxes]
79
  det_img = draw_polys_on_image(text_polygons, img.copy())
80
- return det_img, text_pred #, inline_pred
81
 
82
  # just copy from streamlit_app.py
83
  def layout_detection(img) -> (Image.Image, LayoutResult):
 
72
  det_img = draw_polys_on_image(inline_polygons, img.copy(), color='blue')
73
  return det_img, text_pred, inline_pred
74
 
75
+ # just copy from streamlit_app.py
76
  def text_detection(img) -> (Image.Image, TextDetectionResult):
77
  text_pred = predictors["detection"]([img])[0]
78
  text_polygons = [p.polygon for p in text_pred.bboxes]
79
  det_img = draw_polys_on_image(text_polygons, img.copy())
80
+ return det_img, text_pred
81
 
82
  # just copy from streamlit_app.py
83
  def layout_detection(img) -> (Image.Image, LayoutResult):