-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemoDukeMTMCEvaluation_with_SCT.m
93 lines (75 loc) · 2.98 KB
/
demoDukeMTMCEvaluation_with_SCT.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
%% Fetching data
mex assignmentoptimal.c
% Fetching data
if ~exist('gt/trainval.mat','file')
fprintf('Downloading ground truth...\n');
url = 'http://vision.cs.duke.edu/DukeMTMC/data/ground_truth/trainval.mat';
filename = 'gt/trainval.mat';
outfilename = websave(filename,url);
end
if ~exist('res/baseline.txt','file')
fprintf('Downloading baseline tracker output...\n');
url = 'http://vision.cs.duke.edu/DukeMTMC/data/misc/tracker_output.zip';
filename = 'res/tracker_output.zip';
outfilename = websave(filename,url);
unzip(outfilename,'res');
delete(filename);
end
%% Evaluation
addpath(genpath('devkit'));
trackerOutput = dlmread('res/baseline.txt');
%trackerOutput = dlmread('res/CLUSTmeasure/toy.txt');
%trackerOutput = dlmread('res/ICT/AR/DGDCNN-AVG_mahal_th316.txt');
%trackerOutput = dlmread('res/ICT/GT/HistLBP-AVG_kissme_th283.txt');
% Note that if you are testing AR, it is recommended to turn on id amount
% filtering to speed up the evaluation
world = false; % Image plane
iou_threshold = 0.5;
%testSets = {'trainval_mini_1min'};
testSets = {'val'};
%testSets = {'toy'};
% Evaluate
for i = 1:length(testSets)
testSet = testSets{i};
results{i} = evaluateDukeMTMC_with_SCT(trackerOutput, iou_threshold, world, testSet);
end
%% Display
% Print
for i = 1:length(testSets)
result = results{i};
fprintf('\n-------Results-------\n');
fprintf('Test set: %s\n', testSets{i});
% Single cameras all
fprintf('%s\n',result{9}.description);
printMetrics(result{9}.allMets.mets2d.m);
%fprintf('IDF1 \t IDP \t IDR \t clustF1\t clustP\t clustR\n');
%fprintf('%.2f\t', result{9}.IDmeasures.IDF1);
%fprintf(' %.2f\t', result{9}.IDmeasures.IDP);
%fprintf(' %.2f\t', result{9}.IDmeasures.IDR);
%fprintf(' %.2f\t\t', result{9}.CLUSTmeasures.clustF1);
%fprintf(' %.2f\t', result{9}.CLUSTmeasures.clustP);
%fprintf(' %.2f\t', result{9}.CLUSTmeasures.clustR);
% Multi-cam
k = 10;
fprintf('\n%s\n', result{k}.description);
fprintf('ClustF1\t ClustP\t ClustR\t IDF1 \t IDP \t IDR\n');
fprintf('%.2f\t', result{k}.CLUSTmeasures.clustF1);
fprintf(' %.2f\t', result{k}.CLUSTmeasures.clustP);
fprintf(' %.2f\t', result{k}.CLUSTmeasures.clustR);
fprintf(' %.2f\t', result{k}.IDmeasures.IDF1);
fprintf(' %.2f\t', result{k}.IDmeasures.IDP);
fprintf(' %.2f\n', result{k}.IDmeasures.IDR);
% All individual cameras
fprintf('\n');
for k = 1:8
fprintf('%s\n',result{k}.description);
printMetrics(result{k}.allMets.mets2d.m);
%fprintf('IDF1 \t IDP \t IDR \t clustF1\t clustP\t clustR\t clustRI\n');
%fprintf('%.2f\t', result{k}.IDmeasures.IDF1);
%fprintf(' %.2f\t', result{k}.IDmeasures.IDP);
%fprintf(' %.2f\t', result{k}.IDmeasures.IDR);
%fprintf(' %.2f\t\t', result{k}.CLUSTmeasures.clustF1);
%fprintf(' %.2f\t', result{k}.CLUSTmeasures.clustP);
%fprintf(' %.2f\t', result{k}.CLUSTmeasures.clustR);
end
end