hantech commited on
Commit
2adbf8c
Β·
1 Parent(s): 70dd260

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -50,7 +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(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'])
56
  out = translate(img, model)[0].tolist()
 
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'])
56
  out = translate(img, model)[0].tolist()