DCGAN-tensorflow icon indicating copy to clipboard operation
DCGAN-tensorflow copied to clipboard

Generate higher resolution pictures?

Open quintendewilde opened this issue 7 years ago • 4 comments

Is it possible to create higher resolution images. By for example training the dataset on a higher resize factor? (ex. not 64x64 but 512x512) So that the outputting images are of bigger resolution?

Also addenda: How to create single images output? Instead of grid? I would really want this to work, but I see not solutions in any of the previous issues?? Any help really welcome!

quintendewilde avatar Feb 18 '18 21:02 quintendewilde

Create higher resolution images: You need to specify the output_height as the default value is 64. So, you can run with the command: python main.py --(other arguments) --output_height=512

To save a single image, put this code in utils.py, option 1 where you want to save images

p =samples.shape[0] for i in range(0,p): scipy.misc.imsave('./samples/single_%s_%s.png' %(idx,i), samples[i])

prymania avatar Feb 23 '18 12:02 prymania

Hi @BLCKPSTV,

From what I've understood, the grid is directly related to the batch size. Since the default is 64, it generates an 8x8 grid as output. Try setting it to 1 to get a single image as output instead of a grid. Bear in mind though, a smaller batch size will result in a really large training time. (Unless you plan to use a really small image dataset)

Hope this helps!

neelindap avatar Apr 24 '18 23:04 neelindap

I think if you train at a higher size with --batch_size=1 --option=1 you will get only one image. but omg the training time is long! other --options produce gifs I believe

minxdragon avatar Jul 16 '18 08:07 minxdragon

If you want a higher resolution image, do you have to train the model to output higher resolution images from the get go? You can't indicate the output height to be 512px if you originally trained the output height to be 128px, correct? Also, does the input height have to match the output height? If I try to set the input height to 128px and the output height to something like 640px I get the error below:

ValueError: ('Trying to share variable discriminator/d_h4_lin/Matrix, but specified shape (73728, 1) and found shape (32768, 1).', "NOTE: Usually, this is due to an issue with the image dimensions

avaseghi avatar Aug 11 '19 19:08 avaseghi