Advertisement
Guest User

Untitled

a guest
Feb 15th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. tflib.init_tf()
  2.  
  3. # Load pre-trained network.
  4. url = 'https://drive.google.com/uc?id=1MEGjdvVpUsu1jB4zrXZN7Y4kBBOzizDQ' # karras2019stylegan-ffhq-1024x1024.pkl
  5. with dnnlib.util.open_url(url, cache_dir=config.cache_dir) as f:
  6. _G, _D, Gs = pickle.load(f)
  7. all = []
  8. for i in range(20):
  9. print(i)
  10. rnd = np.random.RandomState()
  11. latents = rnd.randn(1, Gs.input_shape[1])
  12. fmt = dict(func=tflib.convert_images_to_uint8, nchw_to_nhwc=True)
  13. images = Gs.run(latents, None, truncation_psi=0.1, randomize_noise=True, output_transform=fmt)
  14. all.append(images[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement