Closed zbw0329 closed 3 years ago
The Generator
class is wrapped in the pSp
class as the decoder
. That is why you see no direct call to the class in coach.train()
.
If you wish to change the generator class you should change the following lines to call your class:
For initializing the decoder:
https://github.com/eladrich/pixel2style2pixel/blob/3e2ebd82bb3e3719507898f365abcec16597061a/models/psp.py#L31
And when calling the decoder's forward:
https://github.com/eladrich/pixel2style2pixel/blob/3e2ebd82bb3e3719507898f365abcec16597061a/models/psp.py#L94-L97
Just note that the current decoder is designed to work with StyleGAN that operates on 18
inputs. If you change the decoder to something very different, you may need to change the encoder logic as well.
OK, I see. Thanks for your reply
Hi!Thanks for your great work! I notice that the 'Generator' is defined in ‘stylegan2.model.py',and called by the 'psp.py'. But I don't see the relevant code used in the 'coach.train()' function. So I wonder which part of the codes calls generator to sample the pictures,when I was training the model? I want to change the code to use my own generator,which part of codes should I change?