Spaces:
Runtime error
Runtime error
cache fix
Browse files
app.py
CHANGED
@@ -234,13 +234,14 @@ def run_main_app(semantic_concept, word, script, prompt_suffix, font_name, num_s
|
|
234 |
img = render(w, h, 2, 2, step, None, *scene_args)
|
235 |
|
236 |
# compose image with white background
|
237 |
-
img = img[:, :, 3:4] * img[:, :, :3] + torch.ones(img.shape[0], img.shape[1], 3, device=device) * (
|
238 |
-
1 - img[:, :, 3:4])
|
239 |
img = img[:, :, :3]
|
240 |
|
|
|
|
|
241 |
if step % skip == 0:
|
242 |
img_numpy = img.detach().cpu().numpy()*255
|
243 |
-
img_numpy = np.resize(img_numpy, (200, 200))
|
244 |
gif_frames += [img_numpy]
|
245 |
|
246 |
filename = os.path.join(cfg.experiment_dir, "video-svg", f"iter{step:04d}.svg")
|
@@ -268,13 +269,9 @@ def run_main_app(semantic_concept, word, script, prompt_suffix, font_name, num_s
|
|
268 |
scheduler.step()
|
269 |
|
270 |
|
271 |
-
filename = os.path.join(
|
272 |
-
cfg.experiment_dir, "output-svg", "output.svg")
|
273 |
check_and_create_dir(filename)
|
274 |
-
save_svg.save_svg(
|
275 |
-
filename, w, h, shapes, shape_groups)
|
276 |
-
|
277 |
-
# combine_word(cfg.word, cfg.optimized_letter, cfg.font, cfg.experiment_dir, device)
|
278 |
|
279 |
filename = os.path.join(cfg.experiment_dir, "final.gif")
|
280 |
# writer = imageio.get_writer(filename, fps=20)
|
|
|
234 |
img = render(w, h, 2, 2, step, None, *scene_args)
|
235 |
|
236 |
# compose image with white background
|
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()*255
|
244 |
+
img_numpy = np.resize(img_numpy, (200, 200, 3))
|
245 |
gif_frames += [img_numpy]
|
246 |
|
247 |
filename = os.path.join(cfg.experiment_dir, "video-svg", f"iter{step:04d}.svg")
|
|
|
269 |
scheduler.step()
|
270 |
|
271 |
|
272 |
+
filename = os.path.join(cfg.experiment_dir, "output-svg", "output.svg")
|
|
|
273 |
check_and_create_dir(filename)
|
274 |
+
save_svg.save_svg(filename, w, h, shapes, shape_groups)
|
|
|
|
|
|
|
275 |
|
276 |
filename = os.path.join(cfg.experiment_dir, "final.gif")
|
277 |
# writer = imageio.get_writer(filename, fps=20)
|