Skip to content

Commit

Permalink
Merge pull request #80 from neverix/patch-4
Browse files Browse the repository at this point in the history
Update `show` to work with RGBA images
  • Loading branch information
shonenkov authored Dec 6, 2021
2 parents eb2488d + c9469e3 commit a9ea478
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rudalle/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def show(pil_images, nrow=4, size=14, save_dir=None, show=True):
for i, pil_image in enumerate(pil_images):
pil_image.save(join(save_dir, f'img_{count+i}.png'))

pil_images = [pil_image.convert('RGB') for pil_image in pil_images]
imgs = torchvision.utils.make_grid(utils.pil_list_to_torch_tensors(pil_images), nrow=nrow)
if not isinstance(imgs, list):
imgs = [imgs.cpu()]
Expand Down

0 comments on commit a9ea478

Please sign in to comment.