zhengchen1999 / HI-Diff

PyTorch code for our NeurIPS 2023 paper "Hierarchical Integration Diffusion Model for Realistic Image Deblurring"
Apache License 2.0
168 stars 15 forks source link

Testing #2

Open simoneVU opened 1 year ago

simoneVU commented 1 year ago

Hi,

I was wondering when you plan to release the model weights and update the readme for model inference. That would be very interesting! Great paper btw!

Cheers, Simone

zhengchen1999 commented 1 year ago

Thanks for your interest in our work. We plan to release training and testing code soon (probably in September, after the NeurIPS23 results are announced).

simoneVU commented 1 year ago

Thank you very much for the reply! looking forward!

macvincent commented 1 year ago

Hello, just following up on this to find out when the code will be released.

zhengchen1999 commented 1 year ago

Dear @macvincent @simoneVU, we have released training&testing codes and pre-trained models.

macvincent commented 1 year ago

Awesome. Thank you @zhengchen1999. This is awesome work.

TenMiss commented 1 year ago

May I ask how to solve this problem:ModuleNotFoundError: No module named 'basicsr'

zhengchen1999 commented 1 year ago

I think the reason for your error is that Installation are not prepared.

DaddyWesker commented 9 months ago

So, where I can find pretrained models? Here lies files DAT....pth. but code requires experiments/pretrained_models/HI_Diff_RealBlur_J/net_le_dm.pth experiments/pretrained_models/HI_Diff_RealBlur_J/net_g.pth experiments/pretrained_models/HI_Diff_RealBlur_J/net_d.pth

Moreover, it is unclear how to infer model on a custom image. Can you make infer script for custom input image?

zhengchen1999 commented 9 months ago

The pretrained models are provided here.

To test on your own dataset, set yml: dataroot_gt and dataroot_lq to the corresponding directories (both should be the same).

DaddyWesker commented 9 months ago

THanks!

Resulting deblurred image should be there? HI-Diff/results/test_HI_Diff_RealBlur_R/visualization (i'm using RealBlur_R model and yml accordingly)

zhengchen1999 commented 9 months ago

In the RealBlur_R folder (HI-Diff/results/test_HI_Diff_RealBlur_R/visualization/RealBlur_R). Note that the output results are saved only if 'save_img: True' is set in the yml.

DaddyWesker commented 9 months ago

This value is set to true. Well, I've ran this model on my img and it doesn't work i guess. Input: 00001776

Output: 00001776

Maybe I'm doing something wrong. I was thinking on debluring this image but wooden chair is still defocused... And it seems that nothing changed at all.

zhengchen1999 commented 9 months ago

The test should be fine. However, I think your image is defocus-blur, which is inconsistent with our trained model. I suggest you use other defocus-deblur methods such as (Restormer). Of course, you can also try the model trained with GoPro (i.e., GoPro.yml).

DaddyWesker commented 9 months ago

I've tried restormer and it doesn't help either. I'll try GoPro variant, thanks. I've been struggling to find any algorithm to beat that defocus blur but everything failed so far. Thank you anyway.

sunzhe09 commented 9 months ago

我也遇到同样的问题,感觉有一定的去模糊效果,但是处理后还是有一些模糊,不知道需要调整什么参数来优化

alalnjcno commented 7 months ago

请问test的时候 用GoPro的时候只有这一个数据集 input和target里面分别放什么呀 放一样的吗

zhengchen1999 commented 7 months ago

是的,放一样的,结果在results文件夹中。

alalnjcno commented 7 months ago

你好,请问处理后的图象在哪里看呢

zhengchen1999 commented 7 months ago

在results文件夹,yml文件中name对应文件夹,visualization文件夹中。

alalnjcno commented 6 months ago

你好 我使用HI_Diff_GoPro模型 进行测试RealBlur_J 显示 f88bae447d7c2694860fd1e33bd93f6d 是我哪里出错了吗

zhengchen1999 commented 6 months ago

不好意思,我没有遇到过这种情况。请问你的RealBlur_J结果是如何生成的。如果是通过python test.py -opt options/test/GoPro.yml测试得到,那相应的yml文件有修改过吗?

alalnjcno commented 6 months ago

不好意思,我没有遇到过这种情况。请问你的RealBlur_J结果是如何生成的。如果是通过python test.py -opt options/test/GoPro.yml测试得到,那相应的yml文件有修改过吗?

只测试一个数据集 就把GoPro.yml中多余的删掉了 85cf7e3cc0e2d5071d3e14009bf80d56 然后属于以下两条指令python test.py -opt options/test/GoPro.yml python evaluate_realblur.py --dataset RealBlur_J --dir results/test_HI_Diff_GoPro
我在3080上进行测试的

zhengchen1999 commented 6 months ago

你好,我在3090上重新测试了结果: For RealBlur_J dataset PSNR: 29.148628 SSIM: 0.889761 结果正常。因此,如果你没有修改过代码的话,可能是数据集出现问题了。你可以尝试下载一份新的数据集。此外,考虑到你的结果性能很高,会不会是用了target作为input数据(当然,你的yml中并没有设置错路径,这只是我的猜测。

alalnjcno commented 6 months ago

你好,我在3090上重新测试了结果: For RealBlur_J dataset PSNR: 29.148628 SSIM: 0.889761 结果正常。因此,如果你没有修改过代码的话,可能是数据集出现问题了。你可以尝试下载一份新的数据集。此外,考虑到你的结果性能很高,会不会是用了target作为input数据(当然,你的yml中并没有设置错路径,这只是我的猜测。

应该是数据集的问题,您的那个原数据集 是两个文件夹 分别包含清晰与模糊的图像对吗?我下载的好像只有一个文件夹里面是模糊的,还有一个为叫__MACOSX 的文件夹 里面图象损坏

zhengchen1999 commented 6 months ago

__MACOSX请忽略,这是mac压缩造成的额外数据。 另外,请问你下载的数据集链接是哪个?我下载的结果是正常的,位置:https://github.com/zhengchen1999/HI-Diff?tab=readme-ov-file#datasets

PS: 只有"模糊"图像的,是否是我提供的视觉结果,也就是我复原出来的结果,位置:https://github.com/zhengchen1999/HI-Diff?tab=readme-ov-file#models

alalnjcno commented 6 months ago

__MACOSX请忽略,这是mac压缩造成的额外数据。 另外,请问你下载的数据集链接是哪个?我下载的结果是正常的,位置:https://github.com/zhengchen1999/HI-Diff?tab=readme-ov-file#datasets

PS: 只有"模糊"图像的,是否是我提供的视觉结果,也就是我复原出来的结果,位置:https://github.com/zhengchen1999/HI-Diff?tab=readme-ov-file#models

谢谢您 是我数据集下载错了 。还有想问下您在训练过程中 收敛时两个损失函数数值和 测试集上测试的INFO: Validation ValSet 上输出的PSNR大约是多少呀?我在一张卡上训练 fd6ace15d5f7d888e81d73b43d8d04bc 训练结果在完整数据集上测试26左右

zhengchen1999 commented 6 months ago

S1: l_pix: 1.5e-2, Validation: 33 dB S2: l_pix: 1.0e-2 l_pix_diff: 4.5e-1, Validation: 33 dB