Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,7 @@ def xdog(im, gamma=0.98, phi=200, eps=-0.1, k=1.6, sigma=1):
|
|
26 |
|
27 |
def swin_model(img):
|
28 |
h, w = img.shape[0], img.shape[1]
|
|
|
29 |
img = np.transpose(img[:, :, [2, 1, 0]], (2, 0, 1)) / 255.0
|
30 |
img = img[None, ...].astype(np.float32)
|
31 |
mod_pad_h, mod_pad_w = 0, 0
|
@@ -42,6 +43,7 @@ def swin_model(img):
|
|
42 |
_, _, a, b = output.shape
|
43 |
output = output[:, :, 0:a - mod_pad_h, 0:b - mod_pad_w]
|
44 |
output = np.squeeze(output).clip(0, 1)
|
|
|
45 |
return output
|
46 |
|
47 |
|
|
|
26 |
|
27 |
def swin_model(img):
|
28 |
h, w = img.shape[0], img.shape[1]
|
29 |
+
img = cv2.resize(img,(512,512))
|
30 |
img = np.transpose(img[:, :, [2, 1, 0]], (2, 0, 1)) / 255.0
|
31 |
img = img[None, ...].astype(np.float32)
|
32 |
mod_pad_h, mod_pad_w = 0, 0
|
|
|
43 |
_, _, a, b = output.shape
|
44 |
output = output[:, :, 0:a - mod_pad_h, 0:b - mod_pad_w]
|
45 |
output = np.squeeze(output).clip(0, 1)
|
46 |
+
output = cv2.resize(output,(512,512))
|
47 |
return output
|
48 |
|
49 |
|