-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemoDukeMTMCEvaluation.m
78 lines (66 loc) · 2.48 KB
/
demoDukeMTMCEvaluation.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
%% 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');
world = false; % Image plane
iou_threshold = 0.5;
testSets = {'val'};
% Evaluate
for i = 1:length(testSets)
testSet = testSets{i};
results{i} = evaluateDukeMTMC(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);
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\n', result{9}.CLUSTmeasures.clustR);
% Multi-cam
k = 10;
fprintf('\n%s\n', result{k}.description);
fprintf('IDF1 \t IDP \t IDR \t ClustF1\t ClustP\t ClustR\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\n', result{k}.CLUSTmeasures.clustR);
% All individual cameras
fprintf('\n');
for k = 1:8
fprintf('%s\n',result{k}.description);
fprintf('IDF1 \t IDP \t IDR \t ClustF1\t ClustP\t ClustR\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\n', result{k}.CLUSTmeasures.clustR);
end
end