Skip to content

Commit a35bda2

Browse files
committed
update demo to contain test
1 parent 43f3ceb commit a35bda2

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

demo.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ function demo(mode,varargin)
4949
% end
5050
setup = 1;
5151
demo_gui(setup,user_path);
52+
53+
%% Test Mode
54+
% Run everything just once for test
55+
elseif mode == -1
56+
setup = 1;
57+
demo_gui(setup,user_path,mode);
5258
end
5359
end
5460

results/demo/demo_gui.m

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
function demo_gui(set,user_path)
1+
function demo_gui(set,user_path,varargin)
22
%DEMO_GUI executes the processes: segmentation, labelling, classification
33
%and produces the results
44

5+
%%Global Options
6+
seg_overlap = [0.7,0.9];
7+
seg_length = 250;
8+
if ~isempty(varargin)
9+
if varargin{1} == -1
10+
seg_overlap = 0.7;
11+
end
12+
end
13+
14+
515
user_path = char_project_path(user_path);
616
h = waitbar(0,'Initializing...');
717

@@ -49,8 +59,7 @@ function demo_gui(set,user_path)
4959
errordlg('Cannot load project settings','Error');
5060
return
5161
end
52-
seg_overlap = [0.7,0.9];
53-
seg_length = 250;
62+
5463
for i = 1:length(seg_overlap)
5564
seg_properties = [seg_length,seg_overlap(i)];
5665
segmentation_configs = config_segments(new_properties, seg_properties, trajectory_groups, my_trajectories);
@@ -60,7 +69,7 @@ function demo_gui(set,user_path)
6069
%% Labelling
6170
files = {'labels_1301_250_07-tiago.csv','labels_1657_250_09-tiago.csv'};
6271
seg_name = {'segmentation_configs_10388_250_07.mat','segmentation_configs_29476_250_09.mat'};
63-
for i = 1:2
72+
for i = 1:length(seg_overlap)
6473
%check if everything is ok
6574
if ~exist(fullfile(datapath,files{i}),'file') || ~exist(fullfile(project_path,'segmentation',seg_name{i}),'file')
6675
errordlg('Cannot create labels files','Error');
@@ -143,7 +152,7 @@ function demo_gui(set,user_path)
143152

144153
%% Labelling Quality
145154
files = {'labels_1301_250_07-tiago.mat','labels_1657_250_09-tiago.mat'};
146-
for i = 1:2
155+
for i = 1:length(seg_name)
147156
load(fullfile(project_path,'segmentation',seg_name{i}));
148157
load(fullfile(project_path,'labels',files{i}));
149158

0 commit comments

Comments
 (0)