yuval-alaluf / stylegan3-editing

Official Implementation of "Third Time's the Charm? Image and Video Editing with StyleGAN3" (AIM ECCVW 2022) https://arxiv.org/abs/2201.13433
https://yuval-alaluf.github.io/stylegan3-editing/
MIT License
654 stars 73 forks source link

How to change rotation and translation parameters for spatial editing? #2

Closed FeiiYin closed 2 years ago

FeiiYin commented 2 years ago

Thanks for your excellent work! As mentioned in Eq. (1) y=G(w; (r, tx, ty)) in the paper. How do I change the parameters r, tx and ty in code?

yuval-alaluf commented 2 years ago

Hi @FeiiYin This depends on what you're trying to solve. If you want to simply generate random images with various transforms, the original SG3 repo should have what you're looking for: https://github.com/NVlabs/stylegan3#getting-started If you would like to edit random images at various random transforms, you could take a look at our editing script: https://github.com/yuval-alaluf/stylegan3-editing#editing-synthetic-images-with-interfacegan Are you looking for more explict control on the parameters that are used?

FeiiYin commented 2 years ago

Yes, I am looking for explicit control like Fig. 2 in the paper. In my understanding, the method you mentioned is to update the w code of StyleGAN, which is hard to realize the explicit spatial control. After re-reading your paper, now I noticed in the caption of Fig. 2 that you apply the explicit transformation on the Fourier features, and I think I can achieve my goal with a similar procedure. Thanks again for your in time reply!

FeiiYin commented 2 years ago

I find you realized the function in the identity_transform. Thanks!

yuval-alaluf commented 2 years ago

I noticed in the caption of Fig. 2 that you apply the explicit transformation on the Fourier features, and I think I can achieve my goal with a similar procedure.

Yea thats the idea. Modifying the Fourier features to get control over the position and rotation of the generated image

I find you realized the function in the identity_transform.

Correct. This identity control basically means to not alter the fourier features, meaning the image will be aligned.

If you have any other questions feel free to reopen the issue :)