-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Projecting images using class-conditional GANs #148
Comments
Personally when attempting to project an image into a trained class conditional GAN I receive a Additionally: It appears even if you project an image into latent space of a non conditional GAN (using the same image data without labels) and then try to generate an image using the conditional GAN with the --projected_w instead of a --seed there is an assertion error, likely to vector size to a "mismatch" network. |
To project target images using class-conditional GAN, we need to specify the label information in the generator mapping function. That is, we can modify this line in projector.py: w_samples = G.mapping(torch.from_numpy(z_samples).to(device), None) to, for example: w_samples = G.mapping(torch.from_numpy(z_samples).to(device), torch.cat([label]*w_avg_samples, dim=0)) where label is the one-hot encoded vector of the class information (like used in generator.py). Also, I found that the projection gives acceptable results (with slower optimization) even if we don't specify the label (torch.zeros([w_avg_samples, G.c_dim]). |
@yulonglin @hkhailee @Gass2109 @nurpax train loss:step 994/1000: dist 0.22 loss 0.22 |
Is it possible to project images using a class-conditional GAN in this repo? Looking at the code, there doesn't seem to be support for this.
The text was updated successfully, but these errors were encountered: