Coder Social home page Coder Social logo

data_augmentation function about srmd HOT 5 OPEN

cszn avatar cszn commented on May 20, 2024
data_augmentation function

from srmd.

Comments (5)

cszn avatar cszn commented on May 20, 2024

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

from srmd.

yiyunchen avatar yiyunchen commented on May 20, 2024

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.

from srmd.

cszn avatar cszn commented on May 20, 2024

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

from srmd.

yiyunchen avatar yiyunchen commented on May 20, 2024

Is it used to compute the 'count'?

from srmd.

cszn avatar cszn commented on May 20, 2024

Yes. @yiyunchen

from srmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.