NVIDIA / pix2pixHD

Synthesizing and manipulating 2048x1024 images with conditional GANs
https://tcwang0509.github.io/pix2pixHD/
Other
6.57k stars 1.38k forks source link

Diverse output images? #60

Open doantientai opened 5 years ago

doantientai commented 5 years ago

In the paper, it is written that by training the network E we are able to generate diverse images from given inputs. I have trained the network with --instance_feat and --n_clusters 10. However, when I run the test, it gave me only one synthetic image for each input sample. I thought it should give me 10 images for each input samples? I think I am missing something. Please help!

tcwang0509 commented 5 years ago

--n_clusters 10 means it will randomly pick one from the 10 possible clusters. If you want to generate all 10 outputs, you will need to write a for loop.

doantientai commented 5 years ago

Thank you @tcwang0509 , I will try doing that. By the way, it seems not possible to train with --no_instance but still having diverse output because you don't have the Encoder, right? I just want to make sure if I understand the paper correctly.

imnaren142 commented 5 years ago

Hi @doantientai as you said you have tested the your trained model, may I know how are the results of your model? I am training my model with human images.Is the image generated by testing the model different from the training images?And if I do it for humans, will I get a different human image?

doantientai commented 5 years ago

@naren142 Sorry I didn't understand your question. As the purpose of Pix2pixHD is to transform images, it won't generate images from scratch like basic GANs do. So make sure you have paired samples to train the network.

In my case it was medical images. I use the network to transform 3d projections to realistic images. From what I see, the model always works much better on the training dataset, which is normal. However, the performance on the test set is somehow acceptable in my case.

imnaren142 commented 5 years ago

@doantientai thanks for the reply.My question is,if I train it on human image(color image) as target and corresponding mask(label map) and give new mask as input at test time what will it generate?

doantientai commented 5 years ago

@naren142 Yes in that case it will outputs colored human images. With the parameter --num_style you can chose to generate how many output from 1 input.

imnaren142 commented 5 years ago

@doantientai Thanks. Is the generated image same as in the training images or will it generate a new image?

doantientai commented 5 years ago

@naren142 The outputs on test set are similar to ones from training set in general, but they are not (and should not be) exactly the same to any certain sample from training set. You can take a look on images on the paper https://arxiv.org/abs/1804.04732

daeunni commented 1 year ago

@doantientai Hi, where is an --num_style parameter in this code?