Spaces:
Runtime error
Runtime error
Update
Browse files
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
|
| 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)
|