question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we use the . Pt model to generate images and the corresponding dlatents directly?

See original GitHub issue

Hello, can I use the. Pt model to generate dlatent and then generate the images as the official implementation:

    src_latents = np.stack(np.random.RandomState(seed).randn(Gs.input_shape[1]) for seed in src_seeds)
    dst_latents = np.stack(np.random.RandomState(seed).randn(Gs.input_shape[1]) for seed in dst_seeds)
    src_dlatents = Gs.components.mapping.run(src_latents, None) # [seed, layer, component]
    dst_dlatents = Gs.components.mapping.run(dst_latents, None) # [seed, layer, component]
    src_images = Gs.components.synthesis.run(src_dlatents, randomize_noise=False, **synthesis_kwargs)
    dst_images = Gs.components.synthesis.run(dst_dlatents, randomize_noise=False, **synthesis_kwargs)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
lucidrainscommented, Nov 11, 2020
1reaction
wytcsuchcommented, Nov 11, 2020

@wytcsuch sure, I can probably offer a similar interface

what is dst_latents vs src_latents?

Maybe my problem is not clearly described. I hope that I can give Z randomly, and then convert Z to dlatent and finally generate the corresponding image: z- > dlalent - >image

    z = np.stack(np.random.RandomState(seed).randn(Gs.input_shape[1]) for seed in src_seeds) 
    dlatents = Gs.components.mapping.run(z,None) # [seed, layer, component]
    images = Gs.components.synthesis.run(dlatents, randomize_noise=False, **synthesis_kwargs)

You don’t need to understand dst_latents and src_dlatents Specifically, they are both dlatents. I just need to record the dlatent and the corresponding image

Read more comments on GitHub >

github_iconTop Results From Across the Web

stylegan/README.md at master - GitHub
To generate images, you will typically want to use Gs – the other two networks are provided for completeness. In order for pickle.load()...
Read more >
[P] StyleGAN Encoder - from real images to latent representation
I made a implementation of encoder for StyleGAN which can transform a real image to latent representation of generator.
Read more >
Image Generation in 10 Minutes with Generative Adversarial ...
Using Unsupervised Deep Learning to Generate Handwritten Digits with Deep Convolutional GANs using TensorFlow and the MNIST Dataset.
Read more >
arXiv:2207.10435v1 [cs.CV] 21 Jul 2022
Second, after learning, the PDE can be used to predict motions in drastically differ- ent scenes (e.g., with higher densities) and generate more ......
Read more >
Human Trajectory Prediction via Neural Social Physics ...
We use the collision rate to evaluate prediction plausibility. ... We first feed the scene image I to a U-net, Useg, to get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found