Spaces:
Runtime error
Runtime error
cache examples fix
Browse files
app.py
CHANGED
@@ -237,10 +237,8 @@ def run_main_app(semantic_concept, word, script, prompt_suffix, font_name, num_s
|
|
237 |
img = img[:, :, 3:4] * img[:, :, :3] + torch.ones(img.shape[0], img.shape[1], 3, device=device) * (1 - img[:, :, 3:4])
|
238 |
img = img[:, :, :3]
|
239 |
|
240 |
-
print(img.shape)
|
241 |
-
|
242 |
if step % skip == 0:
|
243 |
-
img_numpy = img.detach().cpu().numpy()
|
244 |
img_numpy = np.resize(img_numpy, (200, 200, 3))
|
245 |
gif_frames += [img_numpy]
|
246 |
|
@@ -277,7 +275,8 @@ def run_main_app(semantic_concept, word, script, prompt_suffix, font_name, num_s
|
|
277 |
# writer = imageio.get_writer(filename, fps=20)
|
278 |
# for frame in gif_frames: writer.append_data(frame)
|
279 |
# writer.close()
|
280 |
-
imageio.mimsave(filename, np.array(gif_frames).astype(np.uint8))
|
|
|
281 |
|
282 |
yield gr.update(value=filename_init,visible=True),gr.update(visible=False),gr.update(value=filename,visible=True),gr.update(value=cfg.caption,visible=True),gr.update(value=cfg.seed,visible=True)
|
283 |
|
|
|
237 |
img = img[:, :, 3:4] * img[:, :, :3] + torch.ones(img.shape[0], img.shape[1], 3, device=device) * (1 - img[:, :, 3:4])
|
238 |
img = img[:, :, :3]
|
239 |
|
|
|
|
|
240 |
if step % skip == 0:
|
241 |
+
img_numpy = img.detach().cpu().numpy()
|
242 |
img_numpy = np.resize(img_numpy, (200, 200, 3))
|
243 |
gif_frames += [img_numpy]
|
244 |
|
|
|
275 |
# writer = imageio.get_writer(filename, fps=20)
|
276 |
# for frame in gif_frames: writer.append_data(frame)
|
277 |
# writer.close()
|
278 |
+
# imageio.mimsave(filename, np.array(gif_frames).astype(np.uint8))
|
279 |
+
imageio.mimsave(filename, np.array(gif_frames))
|
280 |
|
281 |
yield gr.update(value=filename_init,visible=True),gr.update(visible=False),gr.update(value=filename,visible=True),gr.update(value=cfg.caption,visible=True),gr.update(value=cfg.seed,visible=True)
|
282 |
|