Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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='
|
155 |
-
[gr.outputs.Image(type='
|
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,
|