Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preprocessing in this work #19

Closed
zhiyang-fu opened this issue Sep 18, 2017 · 8 comments
Closed

Preprocessing in this work #19

zhiyang-fu opened this issue Sep 18, 2017 · 8 comments

Comments

@zhiyang-fu
Copy link

zhiyang-fu commented Sep 18, 2017

In the paper, you mentioned the only preprocessing you did was subtracting the mean RGB value from entire dataset. But did you also preprocess your label(high resolution image) in the same way, subtracting the mean RGB value from all the label images? Another thing I noticed was the constant 255 was used to scale the input in you code. Is it because the dynamic range of input is [0,1]?

Could you show more details about your image preprocessing?

Thanks,

@limbee
Copy link
Owner

limbee commented Sep 18, 2017

The things you mentioned are all the preprocessing we used. For each input and label image, we scale the pixel value to 0~255 and subtract the RGB average value of the DIV2K dataset.

@zhiyang-fu
Copy link
Author

If you compute the mean for the input and label images, they should be different. How do think of subtracting the mean separately for the input and label images? And when you say DIV2K dataset, do you mean the high resolution image?

@limbee
Copy link
Owner

limbee commented Sep 18, 2017

The mean value is calculated over whole DIV2K high-resolution (GT) images, so it should be the same. We apply this single mean value to both of input and label images. What I mean by DIV2K is the high-resolution image.

@zhiyang-fu
Copy link
Author

But the input of network is low resolution image. We are supposed to preprocess on input of network to make faster and better convergence, isn't it? Why don't you compute the mean of all the low resolution images directly?

@limbee
Copy link
Owner

limbee commented Sep 19, 2017

I don't think the pixel mean of low- and high-resolution images differ significantly. The input image is just a bicubic downsampled version of label image, so ideally there should be no mean shift.

@zhiyang-fu
Copy link
Author

zhiyang-fu commented Sep 19, 2017

That is a good point! Thank you! I have a follow up question. Let's say you trained your net on DIV2K dataset, then you are going to test it on another unknown dataset. How are you gonna to preprocess the test image from the unknown dataset? Do you rescale to [0,255] and then subtract the mean of DIV2K dataset? And after you get your output of network, you add back the same mean and rescale it by the same scaling factor. Is this right?

@limbee
Copy link
Owner

limbee commented Sep 19, 2017

When we do some training or testing algorithms in a DIV2K dataset, I think it implicitly assumes that this dataset represents the entire image. Therefore, I think it is correct to use the same mean value as in DIV2K and same preprocessing unless there is information about the statistics of the new dataset. If I test for an unknown dataset, I will do the same as you described.

@zhiyang-fu
Copy link
Author

Thank you very much! I appreciate your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants