forked from votchallenge/toolkit-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vot_browse.m
120 lines (72 loc) · 2.72 KB
/
vot_browse.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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
function vot_browse(trackers, sequences, experiments)
selected_tracker = [];
selected_experiment = [];
selected_sequence = [];
while 1
if isempty(selected_tracker)
if length(trackers) == 1
selected_tracker = 1;
continue;
else
print_text('Choose tracker:');
print_indent(1);
for i = 1:length(trackers)
print_text('%d - "%s"', i, trackers{i}.identifier);
end;
print_text('e - Exit');
print_indent(-1);
option = input('Selected tracker: ', 's');
if (option == 'q' || option == 'e')
break
end;
selected_tracker = int32(str2double(option));
if isempty(selected_tracker) || selected_tracker < 1 || selected_tracker > length(trackers)
selected_tracker = [];
end;
continue;
end;
end;
if isempty(selected_experiment)
print_text('Choose experiment:');
print_indent(1);
for i = 1:length(experiments)
print_text('%d - "%s"', i, experiments{i}.name);
end;
print_text('e - Exit');
print_indent(-1);
option = input('Select experiment: ', 's');
if (option == 'q' || option == 'e')
break
end;
selected_experiment = int32(str2double(option));
if isempty(selected_experiment) || selected_experiment < 1 || selected_experiment > length(experiments)
selected_experiment = [];
end;
continue;
end;
if isempty(selected_sequence)
selected_sequence = select_sequence(sequences);
if isempty(selected_sequence)
selected_experiment = [];
end;
continue;
end;
tracker = trackers{selected_tracker};
experiment_directory = fullfile(tracker.directory, experiments{selected_experiment}.name);
sequence_directory = fullfile(experiment_directory, sequences{selected_sequence}.name);
trajectories = {};
for i = 1:get_global_variable('repeat', 1)
tfile = fullfile(sequence_directory, ...
sprintf('%s_%03d.txt', sequences{selected_sequence}.name, i));
if exist(tfile, 'file')
trajectories{end+1} = read_trajectory(tfile); %#ok<AGROW>
end;
end;
if isempty(trajectories)
print_text('No results found for sequence');
selected_sequence = [];
continue;
end;
visualize_sequence(sequences{selected_sequence}, trajectories{:});
selected_sequence = [];
end;