genforce / sefa

[CVPR 2021] Closed-Form Factorization of Latent Semantics in GANs
https://genforce.github.io/sefa/
MIT License
964 stars 108 forks source link

how to directly use checkpoint from stylegan2-ada-pytorch #9

Closed tianyilt closed 3 years ago

tianyilt commented 3 years ago

Hi, thanks for your great work and easy to use streamlit app. The current available checkpoint has impressed me a lot, however, i find it hard to use other checkpoint from nvlab official repositorys such as stylegan2-ada-pytorch. Detail list following:

different checkpoint type

genfporce checkpoint

I try to download some checkpoint from 'model zoo', the checkpoint end with .pth and load through torch.load()

stylegan2-ada-checkpoint

My trained checkpoint end with .pkl. It seems to be saved in nvlab's unique method.

my effort

ShenYujun commented 3 years ago

You only need to figure out how to visit the weight you would like to factorize. No matter what type of checkpoint you are dealing with, loading the parameters as numpy.ndarray will be good enough. The key implementation is only with two lines.

tianyilt commented 3 years ago

Thanks, I have deployed this algorithm in implicit ae, and it is well to DIY in nvlab's repository.

mikkelmedm commented 3 years ago

Hi @tianyilt, did you get this to work? Have a stylegan2-ada .pkl file that i would like to run as well using Sefa