
%%% Generate the training data.

clear;
% close all;
addpath(genpath('./.'));

batchSize      = 128;        %%% batch size
max_numPatches = batchSize*2000; 
modelName      = 'IR_Mixed';
sigma          = 10;         %%% Gaussian noise level
variance       = 60;
amplify        = 0000000;
stripe_min     = -50;        %%% min value
stripe_max     = 50;         %%% max value


%%% training and testing
% folder_train  = 'Train400';  %%% training
folder_train  = 'C:\data\Place_Training';  %%% training
folder_test   = 'Test/Set68';%%% testing
size_input    = 256;         %%% training
size_label    = 256;         %%% testing
stride_train  = 100;         %%% training
stride_test   = 40;         %%% testing
val_train     = 0;           %%% training % default
val_test      = 1;           %%% testing  % default
% 

%%% training patches
[inputs1, labels1, set1]  = patches_generation(sigma,variance,amplify,stripe_min, stripe_max,size_input,size_label,stride_train,folder_train,val_train,max_numPatches,batchSize);
%%% testing  patches
[inputs4,labels4,set4] = patches_generation(sigma,variance,amplify,stripe_min, stripe_max,size_input,size_label,stride_test,folder_test,val_test,max_numPatches,batchSize);


inputs   = cat(4,inputs1,inputs4);      clear inputs4;
labels   = cat(4,labels1,labels4);      clear labels4;
set      = cat(2,set1,set4);            clear set4;


if ~exist(modelName,'file')
    mkdir(modelName);
end

%%% save data
save(fullfile(modelName,'imdb'), 'inputs','labels','set','-v7.3')

