Justin-Tan / generative-compression

TensorFlow Implementation of Generative Adversarial Networks for Extreme Learned Image Compression
MIT License
512 stars 106 forks source link

how to train on ADE20K? #8

Closed wensihan closed 6 years ago

wensihan commented 6 years ago

what should I do if I want to train the network on the ADE20K? Do I need to write a ADE20K_train.h5 file like the cityscapes_train.h5? And the rescale script like the resize_cityscapes.sh? Looking forward to your response~

Justin-Tan commented 6 years ago

To train on ADE20K the authors resize the width of each image to 512 px. Then specify the -ds ADE20k flag while training. The reason for this is that the encoder reduces the image width and height by a factor of 16, so the dimensions of the input image need to be cropped to the nearest multiple of 16.

wensihan commented 6 years ago

The code you release didn't provide the part of resizing the width, did you?

wensihan commented 6 years ago

And, if I want to use the conditional gan, the original image and semantic image both need to be resized?

Justin-Tan commented 6 years ago

Yes, but resizing is trivial using imagemagick:

for f in ./**/*.png; do
    convert $f -resize 512x $f
done
wensihan commented 6 years ago

Okay, Thank you very much for your reply~