napatswift commited on
Commit
d6cee7d
·
1 Parent(s): 2dfefac

Remove gr.inputs/outputs and fix typo

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -19,7 +19,7 @@ def get_rec(points):
19
  def predict(image_input):
20
  draw_img = image_input.copy()
21
  output = ocr.readtext(image_input)
22
- for polygon in output['det_poloygons']:
23
  p0, p1 = get_rec([int(i) for i in polygon])
24
  draw_img = cv2.rectangle(draw_img, p0, p1, (255,255,255))
25
  return draw_img
@@ -27,8 +27,8 @@ def predict(image_input):
27
  def run():
28
  demo = gr.Interface(
29
  fn=predict,
30
- inputs=gr.inputs.Image(),
31
- outputs=gr.outputs.Textbox(),
32
  )
33
 
34
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
19
  def predict(image_input):
20
  draw_img = image_input.copy()
21
  output = ocr.readtext(image_input)
22
+ for polygon in output['det_polygons']:
23
  p0, p1 = get_rec([int(i) for i in polygon])
24
  draw_img = cv2.rectangle(draw_img, p0, p1, (255,255,255))
25
  return draw_img
 
27
  def run():
28
  demo = gr.Interface(
29
  fn=predict,
30
+ inputs=gr.components.Image(),
31
+ outputs=gr.components.Textbox(),
32
  )
33
 
34
  demo.launch(server_name="0.0.0.0", server_port=7860)