Skip to content

Commit

Permalink
remove transparency when generating interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jun 27, 2020
1 parent d3207f4 commit ad5d07a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name = 'stylegan2_pytorch',
packages = find_packages(),
scripts=['bin/stylegan2_pytorch'],
version = '0.17.0',
version = '0.17.1',
license='GPLv3+',
description = 'StyleGan2 in Pytorch',
author = 'Phil Wang',
Expand Down
2 changes: 1 addition & 1 deletion stylegan2_pytorch/stylegan2_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ def generate_interpolation(self, num = 0, num_image_tiles = 8, trunc = 1.0):
latents = [(interp_latents, num_layers)]
generated_images = self.generate_truncated(self.GAN.SE, self.GAN.GE, latents, n, trunc_psi = self.trunc_psi)
images_grid = torchvision.utils.make_grid(generated_images, nrow = num_rows)
pil_image = transforms.ToPILImage()(images_grid.cpu())
pil_image = transforms.ToPILImage()(images_grid.cpu()).convert('RGB')
frames.append(pil_image)

frames[0].save(str(self.results_dir / self.name / f'{str(num)}.gif'), save_all=True, append_images=frames[1:], duration=80, loop=0, optimize=True)
Expand Down

0 comments on commit ad5d07a

Please sign in to comment.