swz30 / MPRNet

[CVPR 2021] Multi-Stage Progressive Image Restoration. SOTA results for Image deblurring, deraining, and denoising.
Other
1.16k stars 188 forks source link

pytorch version issue #52

Closed hhcs9527 closed 3 years ago

hhcs9527 commented 3 years ago

Hi! Thank you so much for your work! I am wondering if anyone can run the model on PyTorch 1.8.1(stable version)?

Thanks

adityac8 commented 3 years ago

Hi

I am able to train the models on pytorch 1.8.1. However, the pretrained weights were provided for pytorch 1.1 and you might not be able to test using another version.

Thanks

hhcs9527 commented 3 years ago

Hi

Thanks for the useful information! I have another question for the evaluation of PSNR in image_utils.py in utils file.

Why do you calculate the difference between prediction and target by imdff = torch.clamp(prd_img,0,1) - torch.clamp(tar_img,0,1)?

Thanks

adityac8 commented 3 years ago

It is needed to compute the PSNR image

hhcs9527 commented 3 years ago

Thanks for the formula for calculating PSNR. I am wondering why do you perform torch.clamp(prd_img,0,1) before you perform imdff = torch.clamp(prd_img,0,1) - torch.clamp(tar_img,0,1). In the formula that you provided, there is no such operation.

Could you tell me the reason for performing this torch.clamp(prd_img,0,1)?

Thanks

szpxmu commented 3 years ago

hello, how can i test the real rain12 dataset?

adityac8 commented 3 years ago

Hi @hhcs9527

The outputs from the model might be a little outside the range of [0,1]. Hence, in order to make sure that the correct PSNR is calculated, we clamp the outputs between [0,1].

Thanks

adityac8 commented 3 years ago

Hi @hellogry

As per Table 1 in our paper, Rain12 is included in the train set. Hence we do not test on it. image

If you still want to test on Rain12 dataset, you can put the images at this path https://github.com/swz30/MPRNet/blob/435f483b6433a6cf8d43f4df9c20eebba47587bb/Deraining/test.py#L25 and add Rain12 at https://github.com/swz30/MPRNet/blob/435f483b6433a6cf8d43f4df9c20eebba47587bb/Deraining/test.py#L44

Thanks

hhcs9527 commented 3 years ago

Thanks! The last question, I am wondering how do you measure the PSNR/SSIM(PSNR for 32.66 in your paper)? By running test.py, then run evaluate_GOPRO_HIDE.m?

Thanks

adityac8 commented 3 years ago

Hi @hhcs9527

Running test.py would generate the predictions. After that, running evaluate_GOPRO_HIDE.m would evaluate the PSNR/SSIM.

Thanks

hhcs9527 commented 3 years ago

ok, I think I've done my questions, thanks!