Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,10 +47,6 @@ def main(_):
|
|
| 47 |
use_lock=False,
|
| 48 |
)
|
| 49 |
|
| 50 |
-
checkerboard_r1 = np.concatenate([np.zeros((8, 8, 3)), np.ones((8, 8, 3)), np.zeros((8, 8, 3))], axis=1)
|
| 51 |
-
checkerboard_r2 = np.concatenate([np.ones((8, 8, 3)), np.zeros((8, 8, 3)), np.ones((8, 8, 3))], axis=1)
|
| 52 |
-
checkerboard = np.concatenate([checkerboard_r1, checkerboard_r2] * 16, axis=0).astype(np.float32)
|
| 53 |
-
|
| 54 |
def generate_images(input_images, n_new_frames, n_candidates, temperature=1.0, top_p=0.9):
|
| 55 |
assert len(input_images) > 0
|
| 56 |
input_images = [
|
|
@@ -62,14 +58,14 @@ def main(_):
|
|
| 62 |
|
| 63 |
generated_images = []
|
| 64 |
for candidate in output_images:
|
| 65 |
-
|
| 66 |
-
for i
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
generated_images.append(
|
| 71 |
Image.fromarray(
|
| 72 |
-
(
|
| 73 |
)
|
| 74 |
)
|
| 75 |
|
|
@@ -247,4 +243,3 @@ def main(_):
|
|
| 247 |
|
| 248 |
if __name__ == "__main__":
|
| 249 |
mlxu.run(main)
|
| 250 |
-
|
|
|
|
| 47 |
use_lock=False,
|
| 48 |
)
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
def generate_images(input_images, n_new_frames, n_candidates, temperature=1.0, top_p=0.9):
|
| 51 |
assert len(input_images) > 0
|
| 52 |
input_images = [
|
|
|
|
| 58 |
|
| 59 |
generated_images = []
|
| 60 |
for candidate in output_images:
|
| 61 |
+
concatenated_rows = []
|
| 62 |
+
for i in range(len(candidate)):
|
| 63 |
+
concatenated_row = np.concatenate([input_images[i]] + candidate, axis=1)
|
| 64 |
+
concatenated_rows.append(concatenated_row)
|
| 65 |
+
combined_image = np.concatenate(concatenated_rows, axis=0)
|
| 66 |
generated_images.append(
|
| 67 |
Image.fromarray(
|
| 68 |
+
(combined_image * 255).astype(np.uint8)
|
| 69 |
)
|
| 70 |
)
|
| 71 |
|
|
|
|
| 243 |
|
| 244 |
if __name__ == "__main__":
|
| 245 |
mlxu.run(main)
|
|
|