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

Use(load) the npy of the first picture to continue training the npy of the second picture #7

Closed
stone100010 opened this issue Sep 28, 2020 · 2 comments
Labels
question Further information is requested

Comments

@stone100010
Copy link

Hello, I am trying to learn the face information of each frame in a video. For example, I have got the first frame of image through num steps 5000 times. How to use this.Npy to continue training the second frame picture? I look forward to your reply, thank you!

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.72. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the question Further information is requested label Sep 28, 2020
@woctezuma
Copy link
Owner

woctezuma commented Sep 28, 2020

It is an interesting idea. I have not done it, but I think you would only have to edit:

https://github.com/NVlabs/stylegan2/blob/dae148b9bb6346b00c10f0cfc9e011b3ef0c1986/projector.py#L160-L162

def start(self, target_images):
    [...]

    # Prepare target images.
    self._info('Preparing target images...')
    [...]

    # Initialize optimization state.
    self._info('Initializing optimization state...')
    tflib.set_vars({
                    self._target_images_var: target_images, 
                    self._dlatents_var: np.tile(self._dlatent_avg, [self._minibatch_size, 1, 1])
                    })
    [...]

so that the optimization starts from an array w fed as input by the user instead of always the same w_avg:

np.tile(self._dlatent_avg, [self._minibatch_size, 1, 1])

It is a bit similar to the idea of improving the initialization here: rolux/stylegan2encoder#2

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

No branches or pull requests

2 participants