Open qingqingisrunning opened 2 years ago
You can download the official styleGAN2 weights from here: https://nvlabs-fi-cdn.nvidia.com/stylegan2/networks/ For example, you would want to download the car model from https://nvlabs-fi-cdn.nvidia.com/stylegan2/networks/stylegan2-car-config-f.pkl
The official styleGAN2 weights are in TensorFlow, so I converted the weights into PyTorch weights using this script: https://github.com/rosinality/stylegan2-pytorch/blob/master/convert_weight.py
Hope this helps!
Thank you very much! The tensorflow weights have been converted into pytorch weights on gtx2060...Thanks!!!
And how could I convert/project user sketch into fixed_z (expect a .pth file) in generate.py?
We first provide some certain vehicle sketches with similar poses for training customized vehicle sketchgan model, and in the generation stage, we must put a random z or a real projected image rather than a user sketch into this customized gan model to generate real car images with similar poses of the input training sketches.
Do different vehicle poses correspond to different customized gan models? @PeterWang512
Inference time the new model takes in the latent vector, and it can be sampled from a Gaussian or a latent projected from an image.
Yes, different vehicle poses correspond to different customized gan if the training sketches consist of just one pose. We haven't tried training on sketches with multiple poses yet, but it is possible that, for example, you can get a sports car model by using sport car sketches of different poses as training inputs. Hope this helps!
For projection, we use pix2latent to get the latent z vector. The repo is here: https://github.com/minyoungg/pix2latent
I really appreciate your help!
Can you please tell if we have our own model trained in stylegan2 how can we generate netG and netD files
we must put a random z or a real projected image rather than a user sketch into this customized gan model to generate real car images with similar poses of the input training sketches.
@qingqingisrunning Can you tell me how can I put my sketch into the trained model? I have completed the training, but don't know how to generate images according to a new sketch. I noticed a .pth file(fixed_z) is needed, but how to convert an image into the .pth? (pix2latent has been tried, but (1)it outputs a .npy file, is it the same format as the required .pth? (2)sample is in size512, my image sized 256 resulting error[RuntimeError: mat1 dim 1 must match mat2 dim 0])
Thanks for sharing this repo. I would like to train my own sketchgan for generating pictures of vehicles. Could you provide the pytorch pretrained stylegan2-car (and train, bus etc.) netD and netG model? Thanks.