Spaces:
Runtime error
Runtime error
Update app.py
Browse filesfix resize BUG
app.py
CHANGED
|
@@ -107,7 +107,7 @@ def run(*args):
|
|
| 107 |
ims2 = []
|
| 108 |
for idx, (b, im1, im2, cond_weight) in enumerate(zip(*inps)):
|
| 109 |
if idx > 1:
|
| 110 |
-
if im1 is not None or im2 is not None:
|
| 111 |
if im1 is not None:
|
| 112 |
h, w, _ = im1.shape
|
| 113 |
else:
|
|
@@ -119,10 +119,11 @@ def run(*args):
|
|
| 119 |
ims1.append(im1)
|
| 120 |
ims2.append(im2)
|
| 121 |
continue
|
| 122 |
-
if
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
|
|
|
| 126 |
ims1.append(im1)
|
| 127 |
ims2.append(im2)
|
| 128 |
|
|
|
|
| 107 |
ims2 = []
|
| 108 |
for idx, (b, im1, im2, cond_weight) in enumerate(zip(*inps)):
|
| 109 |
if idx > 1:
|
| 110 |
+
if b != 'Nothing' and (im1 is not None or im2 is not None):
|
| 111 |
if im1 is not None:
|
| 112 |
h, w, _ = im1.shape
|
| 113 |
else:
|
|
|
|
| 119 |
ims1.append(im1)
|
| 120 |
ims2.append(im2)
|
| 121 |
continue
|
| 122 |
+
if b != 'Nothing':
|
| 123 |
+
if im1 is not None:
|
| 124 |
+
im1 = cv2.resize(im1, (w, h), interpolation=cv2.INTER_CUBIC)
|
| 125 |
+
if im2 is not None:
|
| 126 |
+
im2 = cv2.resize(im2, (w, h), interpolation=cv2.INTER_CUBIC)
|
| 127 |
ims1.append(im1)
|
| 128 |
ims2.append(im2)
|
| 129 |
|