DerrylNessie commited on
Commit
f16ccdd
1 Parent(s): 2e14c58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -39,13 +39,13 @@ def inference(img, lang):
39
  mask = Image.new("L", im.size, 0)
40
 
41
  draw_mask(mask, bounds)
42
- img_inpainted = cv2.inpaint(im, mask, 7, cv2.INPAINT_NS)
43
  #remove_text(im, mask, bounds)
44
  lang = ""
45
  im.save('result.jpg')
46
- mask.save('mask.jpg')
47
- img_inpainted.save('inpaint.jpg')
48
- return ['result.jpg', 'mask.jpg', 'inpaint.jpg', pd.DataFrame(bounds). iloc[: , 1:2]]
49
 
50
  title = 'EasyOCR'
51
  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.'
@@ -61,7 +61,7 @@ choices = [
61
  gr.Interface(
62
  inference,
63
  [gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default="korean", label='language')],
64
- [gr.outputs.Image(type='file', label='Output'), gr.outputs.Image(type='file', label='Output'), gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe()],
65
  title=title,
66
  description=description,
67
  article=article,
 
39
  mask = Image.new("L", im.size, 0)
40
 
41
  draw_mask(mask, bounds)
42
+ #img_inpainted = cv2.inpaint(im, mask, 7, cv2.INPAINT_NS)
43
  #remove_text(im, mask, bounds)
44
  lang = ""
45
  im.save('result.jpg')
46
+ mask.save('mask.png')
47
+ #img_inpainted.save('inpaint.jpg')
48
+ return ['result.jpg', 'mask.png', pd.DataFrame(bounds). iloc[: , 1:2]]
49
 
50
  title = 'EasyOCR'
51
  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.'
 
61
  gr.Interface(
62
  inference,
63
  [gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default="korean", label='language')],
64
+ [gr.outputs.Image(type='file', label='Output'), gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe()],
65
  title=title,
66
  description=description,
67
  article=article,