-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathevaluate.m
50 lines (40 loc) · 1.33 KB
/
evaluate.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
% main function.
% get parameters.
expidx = 2;
p = bbox_exp_params(expidx);
if(~p.useGT)
% convert *.txt to *.mat
fprintf('Use dection to track.\n');
% convert_txt2mat(p);
else
% getnerate detections mat from annolist.bbox.
fprintf('Use ground truth to track.\n');
save_dir = p.matDetectionsDir;
convert_gt_anno2mat(p.trainGT, save_dir);
convert_gt_anno2mat(p.testGT, save_dir);
end
% Test model
% Index of the video. Use any value between 1-30
start_index = 1;
% Number of videos to process starting from the index 'start_index'
num_videos = 30;
% multiple object tracking
bbox_tracking(2, start_index, num_videos, false, true);
% convert prediction to txt format follow MOT15 format.
curSaveDir = fullfile(p.expDir, 'prune_tmp');
convert_prediction2txt( expidx, p.motPredictionSaveDir, p.testGT, p.ptMulticutDir, p.pruneThresh, curSaveDir);
% evaluate the performance.
benchmarkDir = p.motDir;
seqfile = fullfile(p.evlSeqmaps, 'eval.txt');
isShowFP = 0;
vidDir = p.vidDir;
allMets = evaluateTracking(seqfile, p.motPredictionSaveDir, benchmarkDir, vidDir, isShowFP );
% visualize bad case.
total_videos = size(allMets.mets2d, 2);
for vidx = 1:total_videos
res = allMets.mets2d(vidx);
if res.m(end-2) < 50
bbox_vis_people(expidx, vidx, curSaveDir);
% bbox_vis_people(expidx, vidx);
end
end