-
Notifications
You must be signed in to change notification settings - Fork 1
/
runner.m
105 lines (89 loc) · 3.82 KB
/
runner.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
clear all;
% _ _ _
% /\ | | | | (_)
% / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___
% / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ __|
% / ____ \ |_| | || (_) | | | | | | (_| | |_| | (__
% /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___|
% _ _ _ _ _
% | | | | | | | | |
% ___ ___| | | __| | ___| |_ ___ ___| |_ ___ _ __
% / __/ _ \ | | / _` |/ _ \ __/ _ \/ __| __/ _ \| '__|
% | (_| __/ | | | (_| | __/ || __/ (__| || (_) | |
% \___\___|_|_| \__,_|\___|\__\___|\___|\__\___/|_|
% _ _ _
% | | | | | |
% __ _ _ __ __| | | |_ _ __ __ _ ___| | _____ _ __
% / _` | '_ \ / _` | | __| '__/ _` |/ __| |/ / _ \ '__|
% | (_| | | | | (_| | | |_| | | (_| | (__| < __/ |
% \__,_|_| |_|\__,_| \__|_| \__,_|\___|_|\_\___|_|
% Author: Pedro Damian Kostelec
% Large parts of the detector were written by Arteta et al.
% Original development: May-August 2014
%============================================================================%
% Configuration
%============================================================================%
datasetIDs = [2]; % Look into dataFolders.m
trainDetector = true;
trainTracker = true;
testDetector = true;
testTracker = true;
showTracks = true;
askForSaveFigure = false;
% If you are not satisfied with the results of the tracker, you can use the
% `tweak` tool to adjust the trajectories.
%============================================================================%
% Train & Test
%============================================================================%
% NO NEED DO TOUCH THIS BELOW
% addpath('somelightspeed')
title = [...
' ___ __ ___ __ __ ___ \n' ...
' /\\ | | | / \\ |\\/| /\\ | | / ` / ` |__ | | \n' ...
'/~~\\ \\__/ | \\__/ | | /~~\\ | | \\__, \\__, |___ |___ |___ \n' ...
' __ ___ ___ ___ __ ___ __ __ __ \n' ...
'| \\ |__ | |__ / ` | / \\ |__) /\\ |\\ | | \\\n' ...
'|__/ |___ | |___ \\__, | \\__/ | \\ /~~\\ | \\| |__/\n' ...
'___ __ __ ___ __ \n' ...
' | |__) /\\ / ` |__/ |__ |__)\n' ...
' | | \\ /~~\\ \\__, | \\ |___ | \\ v1.0 alpha\n\n' ...
];
fprintf(title);
overrides = struct('testAll', true, 'trainSplit', 1, 'features', [1 1 0 1 1 1 0]);
ctrlParams = detector.ctrlParams(overrides);
for dataset=datasetIDs
clear DSIN DSOUT;
dataParams = detector.loadDatasetInfo(dataset, ctrlParams);
if trainDetector
fsectionf('Training detector on dataset %d', dataset);
detector.trainDetector(dataset,ctrlParams, dataParams);
end
if testDetector
fsectionf('Detecting cells in dataset %d', dataset);
detector.detectCells(dataset,ctrlParams, dataParams);
end
end
for dataset=datasetIDs
clear DSIN DSOUT;
dataParams = tracker.loadDatasetInfo(dataset);
if trainTracker
fsectionf('Training tracker on dataset %d', dataset);
tracker.trainTracker(dataset, dataParams);
end
if testTracker
fsectionf('Tracking cells in dataset %d', dataset);
tracker.trackCells(dataset, dataParams);
end
if showTracks
fsectionf('Plotting trajectories from dataset %d', dataset)
tracker.plotTrajectories(dataset, dataParams);
if askForSaveFigure
addpath(fullfile('dependencies', 'export_fig'));
fprintf('Press any key to save plot\n')
pause
file = sprintf('../writing/thesis/images/fig_tracking_robust_%d', dataset);
export_fig(sprintf('%s.eps', file), '-eps', '-transparent', '-painters')
% export_fig(sprintf('%s.png', file), '-eps', '-transparent', '-painters')
end
end
end