JingyunLiang / SwinIR

SwinIR: Image Restoration Using Swin Transformer (official repository)
https://arxiv.org/abs/2108.10257
Apache License 2.0
4.32k stars 531 forks source link

one question #48

Closed sherlybe closed 2 years ago

sherlybe commented 2 years ago

hi,this is great work. I want to use this network for single image deraining, and what parts of this code can I modify? Or do you have any good suggestions? thanks!

JingyunLiang commented 2 years ago

SwinIR has not been tested on deraining yet, but it should be able to generalize to different restoration tasks.

sherlybe commented 2 years ago

SwinIR has not been tested on deraining yet, but it should be able to generalize to different restoration tasks.

ok 谢谢

JingyunLiang commented 2 years ago

Feel free to open it if you have more questions

sherlybe commented 2 years ago

hi,when i test denosing,shows the following error. how to slove it? thanks image

JingyunLiang commented 2 years ago

Incorrect image path.

sherlybe commented 2 years ago

Incorrect image path.

image i dont modify the path.

sherlybe commented 2 years ago

image as the above...

JingyunLiang commented 2 years ago

It seems that you are using Windows. I guess the path may not be correct (Windows may use \\ instead of / for file path). Could you please add

print(path)

below this line? https://github.com/JingyunLiang/SwinIR/blob/c24fb460d41e0d7e87b9c16854a4acdb01db5a82/main_test_swinir.py#L60

sherlybe commented 2 years ago

ok it work,thanks! but i have a question,from the Visual comparison,SwinIR seems the image is more smooth, 这就是处理过后的效果吗? image 6_SwinIR

sherlybe commented 2 years ago

为了方便我还是用中文跟您交流吧。还有一个问题就是,您认为什么任务对于去雨的泛化效果最好?

JingyunLiang commented 2 years ago

For the first question, what are the compared methods? What is your setting?

For the second question, I think if you wanna test it on deraining, train it on deraining datasets.

sherlybe commented 2 years ago

For the first question, what are the compared methods? What is your setting?

For the second question, I think if you wanna test it on deraining, train it on deraining datasets.

第一个问题我意思是如图所示,第一幅图是您的测试数据集McMaster里的图片,第二幅图是测试出的result图,我的问题是:结果图看起来比测试图像更平滑了,这就是本方法的复原效果吗?

JingyunLiang commented 2 years ago

Since SwinIR is only trained by L1 loss in this case, blurry results are expected. If you want to make it be sharp, you can add GAN loss and perceptual loss as in real-world image SR.

sherlybe commented 2 years ago

ok i got it!您的方法非常具有研究性,我会继续深入研究,后续一定会有很多问题值得和您讨论。非常感谢!

sherlybe commented 2 years ago

hi,经过几天的研究, 我带着问题回来了。根据您的建议,我重新对模型进行训练。我使用1200对图像进行训练,我的训练日志如下txt文件,我设置的dataset_type:dncnn,由于设备条件限制,我设置了numwork==0,batch_size==1,为了快速查看模型效果,我设置了100个epoch,一共训练九个小时,训练出结果显示,对于去雨并无效果(是我的训练设置出问题了吗?)我的trainH全是高清图像,trainL是加了雨纹的图像,如果我按照要求将图像成对的训练,我把dataset_type改成plain,但是它报错了,如下图所示,我该如何解决? trainlog.txt image

Zruto commented 2 years ago

hi,经过几天的研究, 我带着问题回来了。根据您的建议,我重新对模型进行训练。我使用1200对图像进行训练,我的训练日志如下txt文件,我设置的dataset_type:dncnn,由于设备条件限制,我设置了numwork==0,batch_size==1,为了快速查看模型效果,我设置了100个epoch,一共训练九个小时,训练出结果显示,对于去雨并无效果(是我的训练设置出问题了吗?)我的trainH全是高清图像,trainL是加了雨纹的图像,如果我按照要求将图像成对的训练,我把dataset_type改成plain,但是它报错了,如下图所示,我该如何解决? trainlog.txt image

你好,可以交流一下关于去雨的训练代码吗