Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode only coarse dlatents #8

Closed
jakeelwes opened this issue Jun 18, 2019 · 1 comment
Closed

Encode only coarse dlatents #8

jakeelwes opened this issue Jun 18, 2019 · 1 comment

Comments

@jakeelwes
Copy link

Hey @pbaylies thanks for this repo! :)
You suggested to predict pose I could train a resnet to predict just the coarse dlatents (Puzer#15).

Would it be something to do with this reshape?

x = Reshape((model_scale, 512))(x) # train against all dlatent values

Or changing the size of W?

W = Gs.components.mapping.run(Z, None, minibatch_size=minibatch_size) # Use mapping network to get unique dlatents for more variation.
dlatent_avg = Gs.get_var('dlatent_avg') # [component]
W = (W[np.newaxis] - dlatent_avg) * np.reshape([truncation, -truncation], [-1, 1, 1, 1]) + dlatent_avg # truncation trick and add negative image pair
W = np.append(W[0], W[1], axis=0)
W = W[:, :mod_r]
W = W.reshape((n*2, model_scale, 512))

Thanks for your help, sorry I'm not from a ML background.

@pbaylies
Copy link
Owner

Hi @jakeelwes -- for a simpler example, take a look at this file from issue #1 -- it only predicts a single 512-wide vector for everything, so that includes the pose. This is also what StyleGAN does while training.

I'm not originally from an ML background either, I've just been programming for a long time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants