Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -50,6 +50,7 @@ def inference(filepath, lang):
|
|
50 |
# crop the region of interest (ROI)
|
51 |
img = Image.open(filepath)
|
52 |
#img = img[y0:y1, x0:x1]
|
|
|
53 |
img = img.crop((max(0,x1-5), max(0,y1-5), min(x3+5,width), min(y3+5, height))) # crop the image
|
54 |
img = process_input(img, config['dataset']['image_height'],
|
55 |
config['dataset']['image_min_width'], config['dataset']['image_max_width'])
|
|
|
50 |
# crop the region of interest (ROI)
|
51 |
img = Image.open(filepath)
|
52 |
#img = img[y0:y1, x0:x1]
|
53 |
+
width, height =img.size
|
54 |
img = img.crop((max(0,x1-5), max(0,y1-5), min(x3+5,width), min(y3+5, height))) # crop the image
|
55 |
img = process_input(img, config['dataset']['image_height'],
|
56 |
config['dataset']['image_min_width'], config['dataset']['image_max_width'])
|