Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save makeyourownalgorithmicart/de4cb4b03ad01b931d05b5b7e4fe01da to your computer and use it in GitHub Desktop.
Save makeyourownalgorithmicart/de4cb4b03ad01b931d05b5b7e4fe01da to your computer and use it in GitHub Desktop.
downloading images from colab, note doesn't work on its own
from google.colab import drive
drive.mount('./data')
from google.colab import files
###
# plot 6-image samples, save to file
f, axarr = plt.subplots(2,3, figsize=(16,8))
for i in range(2):
for j in range(3):
img = G.forward(generate_random(100)).view(64,64).detach().cpu().numpy()
img = (img + 1.0)/2.0
axarr[i,j].imshow(img, interpolation='none', cmap='gray')
pass
pass
t = datetime.datetime.fromtimestamp(time.time())
fname = "img_%s.png" % (t.strftime('%H-%M-%S'))
plt.savefig(fname)
files.download(fname)
plt.close(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment