Fix app.py (#2)
Browse files- Fix app.py (7cb78e30412e96e95ddb301e5f49dad50d1b4230)
Co-authored-by: sky <[email protected]>
app.py
CHANGED
@@ -55,7 +55,8 @@ model.eval()
|
|
55 |
# def predict(image_1, image_2):
|
56 |
# images = [image_1, image_2]
|
57 |
@spaces.GPU
|
58 |
-
def predict(image, resolution
|
|
|
59 |
# Image is a RGB numpy array.
|
60 |
resolution = [int(int(reso)//32*32) for reso in resolution.strip().split('x')]
|
61 |
images = [image]
|
|
|
55 |
# def predict(image_1, image_2):
|
56 |
# images = [image_1, image_2]
|
57 |
@spaces.GPU
|
58 |
+
def predict(image, resolution):
|
59 |
+
resolution = f"{image.shape[1]}x{image.shape[0]}" if resolution == '' else resolution
|
60 |
# Image is a RGB numpy array.
|
61 |
resolution = [int(int(reso)//32*32) for reso in resolution.strip().split('x')]
|
62 |
images = [image]
|