Update app.py

#4
by yanze - opened
Files changed (1) hide show
  1. app.py +6 -5
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 im1 is not None:
123
- im1 = cv2.resize(im1, (w, h), interpolation=cv2.INTER_CUBIC)
124
- if im2 is not None:
125
- im2 = cv2.resize(im2, (w, h), interpolation=cv2.INTER_CUBIC)
 
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