Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -247,8 +247,8 @@ with block:
|
|
247 |
# once user upload an image, the original image is stored in `original_image`
|
248 |
def store_img(img):
|
249 |
# image upload is too slow
|
250 |
-
if min(img.shape[0], img.shape[1]) >
|
251 |
-
img = resize_image(img,
|
252 |
if max(img.shape[0], img.shape[1])*1.0/min(img.shape[0], img.shape[1])>2.0:
|
253 |
raise gr.Error('image aspect ratio cannot be larger than 2.0')
|
254 |
return img, img, [], None # when new image is uploaded, `selected_points` should be empty
|
|
|
247 |
# once user upload an image, the original image is stored in `original_image`
|
248 |
def store_img(img):
|
249 |
# image upload is too slow
|
250 |
+
if min(img.shape[0], img.shape[1]) > 1024:
|
251 |
+
img = resize_image(img, 1024)
|
252 |
if max(img.shape[0], img.shape[1])*1.0/min(img.shape[0], img.shape[1])>2.0:
|
253 |
raise gr.Error('image aspect ratio cannot be larger than 2.0')
|
254 |
return img, img, [], None # when new image is uploaded, `selected_points` should be empty
|