hantech commited on
Commit
96f054d
β€’
1 Parent(s): 1f24223

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -48,6 +48,7 @@ def inference(img, lang):
48
  x1 = bbox[1].max()
49
 
50
  # crop the region of interest (ROI)
 
51
  img = img[y0:y1, x0:x1]
52
  img = process_input(img, config['dataset']['image_height'],
53
  config['dataset']['image_min_width'], config['dataset']['image_max_width'])
@@ -151,8 +152,8 @@ choices = [
151
  ]
152
  gr.Interface(
153
  inference,
154
- [gr.inputs.Image(type='pil', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['en'], label='language')],
155
- [gr.outputs.Image(type='pil', label='Output'), gr.outputs.Dataframe(headers=['text', 'confidence'])],
156
  title=title,
157
  description=description,
158
  article=article,
 
48
  x1 = bbox[1].max()
49
 
50
  # crop the region of interest (ROI)
51
+ img = Image.open(img.name)
52
  img = img[y0:y1, x0:x1]
53
  img = process_input(img, config['dataset']['image_height'],
54
  config['dataset']['image_min_width'], config['dataset']['image_max_width'])
 
152
  ]
153
  gr.Interface(
154
  inference,
155
+ [gr.inputs.Image(type='file', label='Input'),gr.inputs.CheckboxGroup(choices, type="value", default=['en'], label='language')],
156
+ [gr.outputs.Image(type='file', label='Output'), gr.outputs.Dataframe(headers=['text', 'confidence'])],
157
  title=title,
158
  description=description,
159
  article=article,