Last active
July 3, 2019 01:13
-
-
Save makeyourownalgorithmicart/de4cb4b03ad01b931d05b5b7e4fe01da to your computer and use it in GitHub Desktop.
downloading images from colab, note doesn't work on its own
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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