-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathrun.m
More file actions
64 lines (64 loc) · 2.64 KB
/
run.m
File metadata and controls
64 lines (64 loc) · 2.64 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%-----step 1: compute all the renders, integral feature maps, and losses
%-----(for inference losses are not needed)
disp('step 1: compute all the renders, integral features, and losses');
cd ./determine_dimensions
load('houseidlist.mat');
cd ../efficient_render_and_feature
for ii=52:52
tic;
houseid=houseidlist(ii);
disp(['processing house #',int2str(houseid)]);
[ all_img_data,all_renderlinerects_homography_batched,all_transformed_image,all_renderlinerects_homography,goodimages,all_foreground_prob_rgb,all_foreground_prob_hsv,all_tform,all_wallloss,all_windowloss,all_doorloss,label ] = efficient_render_init( houseid,0 );
t=toc;
disp(['Processing time: ',num2str(t),' seconds.']);
[ features ] = integral_feature( houseid,all_transformed_image,all_tform,goodimages,all_foreground_prob_rgb,all_foreground_prob_hsv );
% save intermediate files for easier debugging, though it takes lots of space and time
save(['./loss_and_label/house',int2str(houseid),'.mat'],'all_wallloss','all_windowloss','all_doorloss','label');
save(['./integral_feature/house',int2str(houseid),'.mat'],'features');
save(['./render_init/house',int2str(houseid),'.mat'],'all_renderlinerects_homography_batched');
clear all_wallloss all_windowloss all_doorloss features all_renderlinerects_homography_batched
end
cd ..
clear
%-----step 2: compute all the final feature
disp('step 2: compute all the final feature');
cd ./determine_dimensions
load('houseidlist.mat');
cd ../efficient_render_and_feature
for ii=52:52
tic;
houseid=houseidlist(ii);
disp(['processing house #',int2str(houseid)]);
[ final_features_allviews,wall_loss,window_loss,door_loss,label ] = get_final_feature_loss_1house_init( houseid );
t=toc;
disp(['Processing time: ',num2str(t),' seconds.']);
% save intermediate files for easier debugging, though it takes lots of space and time
save(['./final_feature_init/id',int2str(ii),'.mat'],'final_features_allviews');
end
clear
cd ..
%-----step 3: inference
disp('step 3: inference');
cd ./determine_dimensions
load('houseidlist.mat');
cd ../inference
for ii=52:52
tic;
houseid=houseidlist(ii);
disp(['processing house #',int2str(houseid)]);
[ testresult,testerr,optimalid ] = do_test_init_id( houseid );
allresults(ii,1:7)=testresult;
t=toc;
% this time is not accurate since it includes reading intermediate
% file, which shouldn't be taken into account
disp(['Processing time: ',num2str(t),' seconds.']);
end
cd ..
%-----step 4: visualize
disp('step 4: visualize')
cd ./final_visualization
for ii=52:52
houseid=houseidlist(ii);
visualize_1house( houseid,allresults(ii,:),1,1 );
end
cd ..