Spaces:
Runtime error
Runtime error
Fix
Browse files
model.py
CHANGED
@@ -123,8 +123,8 @@ class Model:
|
|
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(
|
127 |
-
0, 2, 1, 3, 4).reshape(
|
128 |
return PIL.Image.fromarray(grid)
|
129 |
|
130 |
def run_simple(self) -> PIL.Image.Image:
|
|
|
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)
|
128 |
return PIL.Image.fromarray(grid)
|
129 |
|
130 |
def run_simple(self) -> PIL.Image.Image:
|