hantech commited on
Commit
5ff27bf
β€’
1 Parent(s): d3c71f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -82,7 +82,7 @@ def inference(filepath, lang, labels):
82
  out = recognitor.predict(cropped_image)
83
  texts = texts + '\t' + out
84
  result = query(texts, labels)
85
- jsonText = json.dumps(result, ensure_ascii=False).encode('utf8')
86
  im = PIL.Image.open(filepath)
87
  draw_boxes(im, bounds)
88
  im.save('result.jpg')
@@ -98,7 +98,7 @@ choices = [
98
  gr.Interface(
99
  inference,
100
  [gr.inputs.Image(type='filepath', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['vi'], label='language'), gr.inputs.Textbox(label='Labels',default='Người nα»™p, TiαΊΏp nhαΊ­n hα»“ sΖ‘ của')],
101
- [gr.outputs.Image(type='pil', label='Output'), gr.outputs.Textbox(label='Text'), gr.outputs.Textbox(label='Json')],
102
  title=title,
103
  description=description,
104
  article=article,
 
82
  out = recognitor.predict(cropped_image)
83
  texts = texts + '\t' + out
84
  result = query(texts, labels)
85
+ jsonText = json.dumps(result)
86
  im = PIL.Image.open(filepath)
87
  draw_boxes(im, bounds)
88
  im.save('result.jpg')
 
98
  gr.Interface(
99
  inference,
100
  [gr.inputs.Image(type='filepath', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['vi'], label='language'), gr.inputs.Textbox(label='Labels',default='Người nα»™p, TiαΊΏp nhαΊ­n hα»“ sΖ‘ của')],
101
+ [gr.outputs.Image(type='pil', label='Output'), gr.outputs.Textbox(label='Text'), gr.outputs.JSON(label='document')],
102
  title=title,
103
  description=description,
104
  article=article,