Skip to content

Instantly share code, notes, and snippets.

@SamratSahoo
Created November 1, 2020 00:16
Show Gist options
  • Save SamratSahoo/360c9c4fe5c1eb65f9c250d5cefb3328 to your computer and use it in GitHub Desktop.
Save SamratSahoo/360c9c4fe5c1eb65f9c250d5cefb3328 to your computer and use it in GitHub Desktop.
if __name__ == '__main__':
model = Autoencoder()
model.trainModel()
tensor = model.testImage(7777)
# Reshape
tensor = torch.reshape(tensor, (28, 28))
# toImage function
toImage = torchvision.transforms.ToPILImage()
# Convert to image
image = toImage(tensor)
# Save image
image.save('After.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment