DerrylNessie commited on
Commit
ff8025f
1 Parent(s): a2e707c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -49,8 +49,9 @@ def inference(img, lang):
49
  mask = cv.imread('mask.png',0)
50
  dst = cv.inpaint(img,mask,3,cv.INPAINT_TELEA)
51
  #img_inpainted = cv2.inpaint(im, mask, 7, cv2.INPAINT_TELEA)
52
- cv2.imwrite('dst.png', dst)
53
- return ['result.jpg', 'mask.png', 'dst.png', pd.DataFrame(bounds). iloc[: , 1:2]]
 
54
 
55
  title = 'EasyOCR'
56
  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.'
@@ -66,7 +67,10 @@ choices = [
66
  gr.Interface(
67
  inference,
68
  [gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default="korean", label='language')],
69
- [gr.outputs.Image(type='file', label='Output'), gr.outputs.Image(type='file', label='Output'), gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe()],
 
 
 
70
  title=title,
71
  description=description,
72
  article=article,
 
49
  mask = cv.imread('mask.png',0)
50
  dst = cv.inpaint(img,mask,3,cv.INPAINT_TELEA)
51
  #img_inpainted = cv2.inpaint(im, mask, 7, cv2.INPAINT_TELEA)
52
+ #cv2.imwrite('dst.png', dst)
53
+ #dst.save('dst.png')
54
+ return ['result.jpg', 'mask.png', pd.DataFrame(bounds). iloc[: , 1:2]]
55
 
56
  title = 'EasyOCR'
57
  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.'
 
67
  gr.Interface(
68
  inference,
69
  [gr.inputs.Image(type='file', label='Input'),gr.inputs.Dropdown(choices, type="value", default="korean", label='language')],
70
+ [gr.outputs.Image(type='file', label='Output'),
71
+ gr.outputs.Image(type='file', label='Output'),
72
+ #gr.outputs.Image(type='file', label='Output'),
73
+ gr.outputs.Dataframe()],
74
  title=title,
75
  description=description,
76
  article=article,