sanghyun-son / EDSR-PyTorch

PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)
MIT License
2.41k stars 666 forks source link

Artifacts occur in some pictures #57

Open LAccordeur opened 5 years ago

LAccordeur commented 5 years ago

Hi, I tried your code these days and most results were awesome. Thank you for your work! I use the same method of downsample for these pictures, however, there are some artifacts in a few pictures, especially in pictures such as buildings or regular texture. Here is the example. Could you help me?

sanghyun-son commented 5 years ago

Hello.

Would you upload the original high-resolution images with input low-resolution images?

Thank you.

LAccordeur commented 5 years ago

The model I used is EDSR baseline(x2). I find that the picture would has this problem when I used the following command to down sample. img = cv2.resize(img, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_CUBIC

sanghyun-son commented 5 years ago

Have you tried the MATLAB bicubic function?

It is known that MATLAB has a different bicubic implementation compared to the other libraries.

Although I checked that our models (trained with MATLAB bicubic) work well with scipy bicubic function, it would be better to try MATLAB bicubic function first to find out the problem.

LAccordeur commented 5 years ago

Yes, I had tried the MATLAB bicubic function, which didn't have this problem. It's actually caused by the different implementations of bicubic. Thank you for your help.

LAccordeur commented 5 years ago

I am confused about why you choose the MATLAB bicubic function to generate train set. Is it has some advantages compared to other functions such as cv2.resize()?

sanghyun-son commented 5 years ago

It is just because MATLAB bicubic is a standard for many previous super-resolution papers.

By the way, it seems weird because I checked that our models work well with other bicubic implementation (scipy imresize).

LAccordeur commented 5 years ago

Yes, your models work well with scipy imresize. I also tried it before.

Have you tried opencv's bicubic implementation? As I mentioned before, I encountered this problem when I used the following command. I supposed that opencv's implementation is different from the implementation above. img = cv2.resize(img, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_CUBIC

sanghyun-son commented 5 years ago

OK. I will check that issue.

Ir1d commented 5 years ago

@LAccordeur Hi, have you noticed the reason of this? May I ask if using torchvision.transforms.Resize results the same? Thx in advance.

LAccordeur commented 5 years ago

@Ir1d Hi, I'm sorry that I haven't used torchvision.transforms.Resize before, so I don't know if this implement would result the same. Perhaps the different implements of different libraries cause this problem, and here is another #34 issue about this problem and maybe you can find something.