Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,8 @@ def inference(filepath, lang):
|
|
49 |
|
50 |
# crop the region of interest (ROI)
|
51 |
img = Image.open(filepath)
|
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'])
|
55 |
out = translate(img, model)[0].tolist()
|
|
|
49 |
|
50 |
# crop the region of interest (ROI)
|
51 |
img = Image.open(filepath)
|
52 |
+
#img = img[y0:y1, x0:x1]
|
53 |
+
img = img.crop((x0, y0, x1, y1)) # crop the image
|
54 |
img = process_input(img, config['dataset']['image_height'],
|
55 |
config['dataset']['image_min_width'], config['dataset']['image_max_width'])
|
56 |
out = translate(img, model)[0].tolist()
|