-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrunTest.m
30 lines (24 loc) · 906 Bytes
/
runTest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
global no_fast
no_fast = true;
% Following is sample test-case for verifying if everything is working
% correctly.
path = '../Light-Estimation/LDAN/data/real-Cropped/crop_resize_maskout/' %'../data/crop_resize_maskout/';
Files=dir(path);
clear shflatten;
clear shfilename;
shflatten = []
%shflatten = zeros(length(Files)-1, 27);
shfilename = [] %repmat(' ',[length(Files)-1,1]);
for k=3:length(Files)
disp('K IS --------');
disp(k);
filename = strcat(path, Files(k).name); %'000001.jpg.png');
input_image = double(imread(filename))/255;
input_mask = all(input_image > 0,3);
output = SIRFS(input_image, input_mask, [], '');
disp(output.light);
shflatten = [ [shflatten] ; reshape(output.light, [27, 1])'];
shfilename = [ [shfilename]; Files(k).name];
end
csvwrite('RealImage_Celeb_000_SH.csv',shflatten);
csvwrite('RealImage_Celeb_000_names.csv', shfilename);