hysts HF staff commited on
Commit
eab3b8e
1 Parent(s): 0dc864d
Files changed (1) hide show
  1. model.py +1 -2
model.py CHANGED
@@ -120,8 +120,7 @@ class Model:
120
  images = [np.asarray(image) for image in images]
121
  nrows = (len(images) + ncols - 1) // ncols
122
  h, w = images[0].shape[:2]
123
- d = nrows * ncols - len(images)
124
- if d > 0:
125
  images += [np.full((h, w, 3), 255, dtype=np.uint8)] * d
126
  grid = np.asarray(images).reshape(nrows, ncols, h, w, 3).transpose(
127
  0, 2, 1, 3, 4).reshape(nrows * h, ncols * w, 3)
 
120
  images = [np.asarray(image) for image in images]
121
  nrows = (len(images) + ncols - 1) // ncols
122
  h, w = images[0].shape[:2]
123
+ if (d := nrows * ncols - len(images)) > 0:
 
124
  images += [np.full((h, w, 3), 255, dtype=np.uint8)] * d
125
  grid = np.asarray(images).reshape(nrows, ncols, h, w, 3).transpose(
126
  0, 2, 1, 3, 4).reshape(nrows * h, ncols * w, 3)