KupynOrest / DeblurGAN

Image Deblurring using Generative Adversarial Networks
Other
2.51k stars 517 forks source link

The output image problem. #82

Open XiangyuWu opened 6 years ago

XiangyuWu commented 6 years ago

Hi, KupynOrest!

It seemed that the similar problem many others have encountered happened to me, that, in test stage, how to get the output image with the same scale as input image. Though others have submitted relative issues, I still cannot find an answer. The output image in the result dictionary was cropped and resized to 256*256.

Thank you for your help!

shivam2296 commented 6 years ago

Not only this, the code requires the image to be square shaped. Otherwise, it shows a run time error. This is the error I got using this command- --------------------------------------------------------COMMAND------------------------------------------------------------------- python test.py --dataroot mypics3 --model test --dataset_mode single --loadSizeX=720 --loadSizeY=1024 --resize_or_crop=scale_width --learn_residual

--------------------------------------------------------ERROR------------------------------------------------------------------------ File "test.py", line 36, in model.test() File "/home2/shivam/DeblurGAN/models/test_model.py", line 37, in test self.fake_B = self.netG.forward(self.real_A) File "/home2/shivam/DeblurGAN/models/networks.py", line 148, in forward output = input + output RuntimeError: The size of tensor a (341) must match the size of tensor b (344) at non-singleton dimension 2

XiangyuWu commented 6 years ago

I don't have such a problem like you.

I think if you don't include "--loadSizeX=720 --loadSizeY=1024" in your command, your problem may be solved.

shivam2296 commented 6 years ago

Can you generate rectangular images?

XiangyuWu commented 6 years ago

I cannot, and this is my problem.

SophiaSarah commented 6 years ago

Try --resize_or_crop=no_change

shivam2296 commented 6 years ago

Does this work on any sized image? Like 1024X720

On Tue, Jul 3, 2018 at 11:21 AM SophiaSarah notifications@github.com wrote:

Try --resize_or_crop=no_change

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KupynOrest/DeblurGAN/issues/82#issuecomment-402020973, or mute the thread https://github.com/notifications/unsubscribe-auth/AWH51lwLVG3pybqOeQq9f616fSIP3P_fks5uCwZ3gaJpZM4U6ti7 .

SophiaSarah commented 6 years ago

256x144 is workable. I guess 16:9 or 1:1 less than 256 is okay.

Joyce-Lan88 commented 4 years ago

--resize_or_crop no_change