Kidzure commited on
Commit
da17f18
·
verified ·
1 Parent(s): 0cd4dd1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -69,8 +69,8 @@ def resize_image(input_image, resolution):
69
  # once user upload an image, the original image is stored in `original_image`
70
  def store_img(img):
71
  # image upload is too slow
72
- if min(img.shape[0], img.shape[1]) > 1024:
73
- img = resize_image(img, 1024)
74
  if max(img.shape[0], img.shape[1])*1.0/min(img.shape[0], img.shape[1])>2.0:
75
  raise gr.Error('image aspect ratio cannot be larger than 2.0')
76
  return img
 
69
  # once user upload an image, the original image is stored in `original_image`
70
  def store_img(img):
71
  # image upload is too slow
72
+ if min(img.shape[0], img.shape[1]) > 512:
73
+ img = resize_image(img, 512)
74
  if max(img.shape[0], img.shape[1])*1.0/min(img.shape[0], img.shape[1])>2.0:
75
  raise gr.Error('image aspect ratio cannot be larger than 2.0')
76
  return img