Spaces:
Build error
Build error
Update app.py
Browse files
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]) >
|
73 |
-
img = resize_image(img,
|
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
|