Skip to content

Instantly share code, notes, and snippets.

@jasonsalas
Created September 7, 2019 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonsalas/2f6146dc30a893f18cd3198d45c54d77 to your computer and use it in GitHub Desktop.
Save jasonsalas/2f6146dc30a893f18cd3198d45c54d77 to your computer and use it in GitHub Desktop.
Produce DCGAN's generator images from latent space
''' client to produce generator images from latent space '''
import numpy as np
from keras.models import load_model
MODEL = './generator_model_2800.h5'
z_noise = np.random.randn(100*25)
z_noise = z_noise.reshape(25, 100)
model = load_model(MODEL)
X = model.predict(z_noise)
X = (X+1) / 2.0
plt.imshow(X[4])
# show multiple designs
shoe_index = 0
fig, ax = plt.subplots(4, 4, figsize=(11, 11))
fig.subplots_adjust(hspace=0, wspace=0)
for i in range(4):
for j in range(4):
ax[i, j].imshow(X[shoe_index])
ax[i, j].axis('off')
shoe_index += 1
plt.tight_layout()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment