rogerxavier commited on
Commit
b673159
1 Parent(s): f2c823c

Update ofa_ocr.py

Browse files
Files changed (1) hide show
  1. ofa_ocr.py +1 -12
ofa_ocr.py CHANGED
@@ -68,17 +68,6 @@ def ofa_ocr_gr():
68
  ocr_output_image = gr.components.Image(label='图片')
69
  ocr_output_text = gr.components.Dataframe(label='OCR结果', headers=['ID', '文本'])
70
 
71
- # ocr_demo = gr.Interface(
72
- # fn=ocr_api,
73
- # inputs=[ocr_input_image],
74
- # outputs=[ocr_output_image, ocr_output_text],
75
- # title=title,
76
- # description=description,
77
- # allow_flagging='never',
78
- # examples=examples,
79
- # examples_per_page=5,
80
- # cache_examples=True
81
- # )
82
  ocr_demo = gr.Interface(
83
  fn=ocr_api,
84
  inputs=[ocr_input_image],
@@ -91,7 +80,7 @@ def ofa_ocr_gr():
91
  cache_examples=False
92
  )
93
 
94
- return ocr_demo
95
 
96
 
97
  if __name__ == "__main__":
 
68
  ocr_output_image = gr.components.Image(label='图片')
69
  ocr_output_text = gr.components.Dataframe(label='OCR结果', headers=['ID', '文本'])
70
 
 
 
 
 
 
 
 
 
 
 
 
71
  ocr_demo = gr.Interface(
72
  fn=ocr_api,
73
  inputs=[ocr_input_image],
 
80
  cache_examples=False
81
  )
82
 
83
+ return ocr_api#返回子函数最后才能获取box ,至于ocr_demo这个gradio可有可无
84
 
85
 
86
  if __name__ == "__main__":