Eugene Siow commited on
Commit
9eb308e
1 Parent(s): 884899c

Add max_res parameter.

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -40,11 +40,12 @@ def get_model(model_name, scale):
40
 
41
 
42
  def inference(img, scale_str, model_name):
 
43
  scale = int(scale_str.replace('x', ''))
44
  width, height = img.size
45
  print(width, height)
46
- if width > 2048 or height > 2048:
47
- img = img.thumbnail((2048, 2048), Image.ANTIALIAS)
48
  model = get_model(model_name, scale)
49
  try:
50
  inputs = ImageLoader.load_image(img)
 
40
 
41
 
42
  def inference(img, scale_str, model_name):
43
+ max_res = 1024
44
  scale = int(scale_str.replace('x', ''))
45
  width, height = img.size
46
  print(width, height)
47
+ if width > max_res or height > max_res:
48
+ img = img.thumbnail((max_res, max_res), Image.ANTIALIAS)
49
  model = get_model(model_name, scale)
50
  try:
51
  inputs = ImageLoader.load_image(img)