Skip to content

Commit

Permalink
zero out padding when saving illusions
Browse files Browse the repository at this point in the history
  • Loading branch information
Inbum Park committed Nov 29, 2023
1 parent da242eb commit ffbafe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions visual_anagrams/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ def save_illusion(image, views, sample_dir):
size = image.shape[-1]

# Save illusion
save_image(image / 2. + 0.5, sample_dir / f'sample_{size}.png')
save_image(image / 2. + 0.5, sample_dir / f'sample_{size}.png', padding=0)

# Save views of the illusion
im_views = torch.stack([view.view(image[0]) for view in views])
save_image(im_views / 2. + 0.5, sample_dir / f'sample_{size}.views.png')
save_image(im_views / 2. + 0.5, sample_dir / f'sample_{size}.views.png', padding=0)

def save_metadata(views, args, save_dir):
'''
Expand Down

0 comments on commit ffbafe7

Please sign in to comment.