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

Request - Add support for StyleGanV2 #39

Closed
ofirkris opened this issue Dec 15, 2019 · 8 comments
Closed

Request - Add support for StyleGanV2 #39

ofirkris opened this issue Dec 15, 2019 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on

Comments

@ofirkris
Copy link

Hi, Would be great if you can make your encoder support the latest Stylegan version - Reference to Puzer StyleganV2 fork - https://github.com/rolux/stylegan2encoder

@pbaylies pbaylies added enhancement New feature or request good first issue Good for newcomers labels Dec 15, 2019
@pbaylies
Copy link
Owner

pbaylies commented Dec 20, 2019

@ofirkris I've thought about this - this would be better done as a fork of StyleGAN2. Anyone would be welcome to do this in a new repo, currently I'm taking a break from active development over the holidays.

@pbaylies pbaylies added the wontfix This will not be worked on label Dec 20, 2019
@oneiroid
Copy link

Karras implemented projecting to latent space right there in the original repo yo. Don't think it can be improved any more. He's using tiled (1, 512) dlatent though, I suppose as a preemptive measure against censorship activists. Made a couple of changes to project to (18, 512) space: https://github.com/oneiroid/stylegan2

image0001-step2000
image0001-target

@wduo
Copy link

wduo commented Dec 26, 2019

@oneiroid Did you run python align_images.py before python encode_images.py?

@rolux
Copy link

rolux commented Dec 27, 2019

Karras implemented projecting to latent space right there in the original repo yo. Don't think it can be improved any more. He's using tiled (1, 512) dlatent though, I suppose as a preemptive measure against censorship activists. Made a couple of changes to project to (18, 512) space: https://github.com/oneiroid/stylegan2

@oneiroid: Uh, you're totally right!

Ginevra de Benci_01

Ginevra de Benci_01

Optimization video: https://youtu.be/DqOXWb1fvHk

This looks pretty good to me!

@rolux
Copy link

rolux commented Dec 28, 2019

In the meantime, I've done two things: ported this repo to StyleGAN2 (link), at least up to the point where the tutorial notebook runs; and, in my own port of Puzer's encoder (link), added a project_images.py equivalent to encode_images.py.

My impression is that there is a lot of cool stuff in here that would be great to have in StyleGAN2. On the other hand, from a "user" - as opposed to "researcher" - perspective, a two-line change to the projector, plus a bit of glue around it, seems kind of hard to beat.

@woctezuma
Copy link

woctezuma commented Sep 10, 2020

Karras implemented projecting to latent space right there in the original repo yo. Don't think it can be improved any more. He's using tiled (1, 512) dlatent though, I suppose as a preemptive measure against censorship activists. Made a couple of changes to project to (18, 512) space: https://github.com/oneiroid/stylegan2

Hello @oneiroid, would you mind explaining what you meant as "preemptive measure against censorship activists"? I am trying to understand this (18, 512) change (rolux/stylegan2encoder#21), and so far, my understanding is that the visual fidelity is better but the semantic fidelity (for interpolation, etc.) is not. I assume that is the reason why Nvidia's implementation uses (1, 512). I would be curious about your other explanation.

Edit: I have found these related issues (#1, #2), including one created by you.

@oneiroid
Copy link

Hi @woctezuma, I positively wouldn't mind explaining :))
Using (1, 512) dlatents you will never get good projection for any face that was not present in the training dataset.
Using (18, 512) dlats you can project any face. And then you can apply facial attributes directions - emotions, age, gender.
Even celebrity faces! And them celebrities got their faces copyrighted and sold for good money.
So there could've been deepfakes-style hysteria and calls to forbid everything starting from GANs down to internet and propagation of light reflected off their precioussssssss privately owned faces.
Karras and Nvidia do not need such sick activity around them. I hope I made myself clear. I'm a bit distressed recently by all the sick things happening, tried my best :)

@woctezuma
Copy link

Thank you for clarifying. It helps me in my understanding of this change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants