ZeroCommand commited on
Commit
dedd6f2
·
1 Parent(s): 104ed52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -27,7 +27,10 @@ def inference(img, lang):
27
  im = PIL.Image.open(img.name)
28
  draw_boxes(im, bounds)
29
  im.save('result.jpg')
30
- return ['result.jpg', pd.DataFrame(bounds).iloc[: , 1:]]
 
 
 
31
 
32
  title = 'EasyOCR'
33
  description = 'Gradio demo for EasyOCR. EasyOCR demo supports 80+ languages.To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to load them. Read more at the links below.'
@@ -41,7 +44,7 @@ choices = [
41
  gr.Interface(
42
  inference,
43
  [gr.inputs.Image(type='file', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['en'], label='language')],
44
- [gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe(headers=['text'])],
45
  title=title,
46
  description=description,
47
  article=article,
 
27
  im = PIL.Image.open(img.name)
28
  draw_boxes(im, bounds)
29
  im.save('result.jpg')
30
+ # print(pd.DataFrame(bounds).iloc[: , 1:])
31
+ return ['result.jpg', pd.DataFrame(bounds).iloc[: , 1:].to_string(header=False, index=False)]
32
+
33
+ def printOutput()
34
 
35
  title = 'EasyOCR'
36
  description = 'Gradio demo for EasyOCR. EasyOCR demo supports 80+ languages.To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to load them. Read more at the links below.'
 
44
  gr.Interface(
45
  inference,
46
  [gr.inputs.Image(type='file', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['en'], label='language')],
47
+ [gr.outputs.Image(type='file', label='Output'), gr.outputs.Textbox(type='text')],
48
  title=title,
49
  description=description,
50
  article=article,