tamarott / SinGAN

Official pytorch implementation of the paper: "SinGAN: Learning a Generative Model from a Single Natural Image"
https://tamarott.github.io/SinGAN.htm
Other
3.3k stars 612 forks source link

Question about super-resolution for upsampling height & width in varied scale #82

Open DYin65535 opened 4 years ago

DYin65535 commented 4 years ago

Hi,

I am just trying to do super-resolution on an image with only downsampling along the columns. The height is same as the HR image while the width is got squeezed. How could I change the code for that? Thank you so much!

tamarott commented 4 years ago

You can try to use the function imresize_to_shape (At singan/imresize lines 55-61) Instead of imresize that uses a given scale factor, to down/up-sample the image only along the desired dimension. This should be done both in training and at inference time.

On Sat, Feb 15, 2020, 08:04 Dong Yin notifications@github.com wrote:

Hi,

I am just trying to do super-resolution on an image with only downsampling along the columns. The height is same as the HR image while the width is got squeezed. How could I change the code for that? Thank you so much!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tamarott/SinGAN/issues/82?email_source=notifications&email_token=AM5V37MJQIXRR5SRT4GY5QLRC6AXBA5CNFSM4KVVOZNKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INX6MIQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM5V37J2WYXRD7JOXHBHFYLRC6AXBANCNFSM4KVVOZNA .

DYin65535 commented 4 years ago

Thanks for your advice! After I changed all 'imresize' into 'imresize_to_shape' now the code gets successfully run. But when I check the training results, it performs really bad. Compared to my previous test with images squeeze both in height and width which could produce reasonable results in the second scale, the results of images only squeeze in width are still meanless even after 14 scales.

I cannot run the required 18 scales completely because of my limited GPU memory but SinGAN seems failed in this situation. Is it a theoretical problem or I need further modification on the program?

Sincerely thanks for your time!