Created
September 7, 2019 21:49
-
-
Save jasonsalas/2f6146dc30a893f18cd3198d45c54d77 to your computer and use it in GitHub Desktop.
Produce DCGAN's generator images from latent space
This file contains 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
''' 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