cszn / SRMD

Learning a Single Convolutional Super-Resolution Network for Multiple Degradations (CVPR, 2018) (Matlab)
http://openaccess.thecvf.com/content_cvpr_2018/papers/Zhang_Learning_a_Single_CVPR_2018_paper.pdf
422 stars 80 forks source link

data_augmentation function #10

Open yiyunchen opened 5 years ago

yiyunchen commented 5 years ago

When I was runing the generatepatches.m, a error was raised that "undefined function or variable 'data_augmentation'. I would like asking about it, is it a default function or user defined function that no provided? thank you very much!

cszn commented 5 years ago

https://github.com/cszn/SRMD/blob/master/TrainingCodes/utilities/data_augmentation.m

yiyunchen commented 5 years ago

thank you! and I am confused about the code:

for x = 1 : stride : (hei-size_input+1) for y = 1 : stride : (wid-size_input+1) x_l = stride_low(x-1)/stride + 1; y_l = stride_low(y-1)/stride + 1; if x_l+size_input/scale-1 > size(LR,1) || y_l+size_input/scale-1 > size(LR,2) continue; end count=count+1; end end

in generatedpatches. May I ask what this is trying to do. Thank you.

cszn commented 5 years ago

In matlab, pre-define the large matrix is useful to the memery.

For example,

n = 1000000;
A = zeros(1, n); 
for i = 1:n
  A(i) = i; 
end

is better than

n = 1000000;
for i = 1:n
  A(i) = i; 
end
yiyunchen commented 5 years ago

Is it used to compute the 'count'?

cszn commented 5 years ago

Yes. @yiyunchen