kalyan1729 commited on
Commit
836fa3c
·
verified ·
1 Parent(s): 4e7ce08

Add DETRAC-MOT-toolkit

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +19 -0
  2. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/DETRAC_experiment.m +28 -0
  3. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/README.md +71 -0
  4. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/AP_DET_EVAL.exe +3 -0
  5. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/CLEAR_MOT.m +281 -0
  6. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/CLEAR_MOT_EVAL.exe +3 -0
  7. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/DETRAC_DET_EVAL.exe +3 -0
  8. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/DETRAC_MOT_EVAL.exe +3 -0
  9. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/README_evaluation.txt +238 -0
  10. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/VOCap.m +9 -0
  11. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/boxIntersect.m +24 -0
  12. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/boxUnion.m +24 -0
  13. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/boxiou.m +21 -0
  14. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/checkResultFormat.m +90 -0
  15. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/createIntImg.m +16 -0
  16. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/createNewPath.m +16 -0
  17. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/createPath.m +5 -0
  18. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/ACF_detection_PR.txt +21 -0
  19. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/DPM_detection_PR.txt +21 -0
  20. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/R-CNN_detection_PR.txt +21 -0
  21. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/README_curve.txt +3 -0
  22. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/compACT_detection_PR.txt +21 -0
  23. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/detectionEvaluation.m +41 -0
  24. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/clampBBox.m +19 -0
  25. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/displayBBoxes.m +123 -0
  26. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/displayTrackingResult.m +22 -0
  27. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/getColorFromID.m +24 -0
  28. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/reopenFig.m +14 -0
  29. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/showDetectionPRCurve.m +27 -0
  30. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/showResults.m +36 -0
  31. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/dropDetections.m +29 -0
  32. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/dropTracks.m +83 -0
  33. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/evalexe.m +7 -0
  34. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/getMetricInfo.m +21 -0
  35. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/getPRMetricInfo.m +21 -0
  36. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20011_IgR.txt +7 -0
  37. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20012_IgR.txt +6 -0
  38. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20032_IgR.txt +5 -0
  39. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20033_IgR.txt +5 -0
  40. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20034_IgR.txt +5 -0
  41. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20035_IgR.txt +7 -0
  42. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20051_IgR.txt +5 -0
  43. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20052_IgR.txt +6 -0
  44. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20061_IgR.txt +6 -0
  45. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20062_IgR.txt +6 -0
  46. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20063_IgR.txt +6 -0
  47. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20064_IgR.txt +9 -0
  48. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20065_IgR.txt +6 -0
  49. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_39031_IgR.txt +3 -0
  50. DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_39051_IgR.txt +2 -0
.gitattributes CHANGED
@@ -68,3 +68,22 @@ DETRAC/DETRAC-Test-Annotations-XML/DETRAC-Test-Annotations-XML/MVI_40855.xml fil
68
  DETRAC/DETRAC-Test-Annotations-XML/DETRAC-Test-Annotations-XML/MVI_40863.xml filter=lfs diff=lfs merge=lfs -text
69
  DETRAC/DETRAC-Test-Annotations-XML/DETRAC-Test-Annotations-XML/MVI_40864.xml filter=lfs diff=lfs merge=lfs -text
70
  DETRAC/DETRAC-Test-Annotations-XML/DETRAC-Test-Annotations-XML/MVI_40892.xml filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  DETRAC/DETRAC-Test-Annotations-XML/DETRAC-Test-Annotations-XML/MVI_40863.xml filter=lfs diff=lfs merge=lfs -text
69
  DETRAC/DETRAC-Test-Annotations-XML/DETRAC-Test-Annotations-XML/MVI_40864.xml filter=lfs diff=lfs merge=lfs -text
70
  DETRAC/DETRAC-Test-Annotations-XML/DETRAC-Test-Annotations-XML/MVI_40892.xml filter=lfs diff=lfs merge=lfs -text
71
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/AP_DET_EVAL.exe filter=lfs diff=lfs merge=lfs -text
72
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/CLEAR_MOT_EVAL.exe filter=lfs diff=lfs merge=lfs -text
73
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/DETRAC_DET_EVAL.exe filter=lfs diff=lfs merge=lfs -text
74
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/DETRAC_MOT_EVAL.exe filter=lfs diff=lfs merge=lfs -text
75
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/DCT/gco-v3.0/matlab/bin/gco_matlab.mexa64 filter=lfs diff=lfs merge=lfs -text
76
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/DCT/gco-v3.0/matlab/bin/gco_matlab.mexmaci filter=lfs diff=lfs merge=lfs -text
77
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/DCT/gco-v3.0/matlab/bin/gco_matlab.mexmaci64 filter=lfs diff=lfs merge=lfs -text
78
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/FH2T/GraphMultiCarTracker.exe filter=lfs diff=lfs merge=lfs -text
79
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/FH2T/GraphMultiCarTracker.pdb filter=lfs diff=lfs merge=lfs -text
80
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/FH2T/opencv_core231.dll filter=lfs diff=lfs merge=lfs -text
81
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/FH2T/opencv_highgui231.dll filter=lfs diff=lfs merge=lfs -text
82
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/FH2T/opencv_imgproc231.dll filter=lfs diff=lfs merge=lfs -text
83
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/FH2T/tbb.dll filter=lfs diff=lfs merge=lfs -text
84
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/H2T/GraphMultiCarTracker.exe filter=lfs diff=lfs merge=lfs -text
85
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/H2T/GraphMultiCarTracker.pdb filter=lfs diff=lfs merge=lfs -text
86
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/H2T/opencv_core231.dll filter=lfs diff=lfs merge=lfs -text
87
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/H2T/opencv_highgui231.dll filter=lfs diff=lfs merge=lfs -text
88
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/H2T/opencv_imgproc231.dll filter=lfs diff=lfs merge=lfs -text
89
+ DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/trackers/H2T/tbb.dll filter=lfs diff=lfs merge=lfs -text
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/DETRAC_experiment.m ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ % This script can be used to execute the tracking experiments or evaluate the detection results on the UA-DETRAC benchmark
2
+ % Copyright (C)2016 The UA-DETRAC Group
3
+
4
+ % This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
5
+ % the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
+
7
+ % This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
8
+ % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9
+
10
+ % You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+
12
+ clear, clc, close all;
13
+ warning off all;
14
+ global options sequences tracker
15
+
16
+ %% add the path of functions
17
+ addpath(genpath('utils'));
18
+ addpath(genpath('evaluation'));
19
+ addpath(genpath('display'));
20
+
21
+ %% input the name of the tracker
22
+ tracker.trackerName = 'GOG'; % ignore this line when evaluating detection results
23
+ %% initialize the parameters for evalution
24
+ options = initialize_environment();
25
+ %% load the dataset
26
+ sequences = load_datasets();
27
+ %% evaluate the tracker
28
+ run_experiment();
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The DETRAC-MOT evaluation toolkit
2
+ ======================
3
+
4
+ This is the official detection/tracking evaluation kit for the [DETection and tRACking (DETRAC) Benchmark](http://detrac-db.rit.albany.edu/),
5
+ which contains the actual evaluation toolkit as a set of Matlab (Octave compatible) scripts, a readme documentation and several state-of-the-art tracking algorithms.
6
+ You can find more informations from our paper: [arXiv](http://arxiv.org/abs/1511.04136).
7
+
8
+ In addition, if you use the DETRAC benchmark or the evaluation toolkit, please cite the paper:
9
+ @article{DETRAC:CoRR:WenDCLCQLYL15,
10
+ author = {Longyin Wen and Dawei Du and Zhaowei Cai and Zhen Lei and Ming{-}Ching Chang and
11
+ Honggang Qi and Jongwoo Lim and Ming{-}Hsuan Yang and Siwei Lyu},
12
+ title = { {DETRAC:} {A} New Benchmark and Protocol for Multi-Object Detection and Tracking},
13
+ journal = {arXiv CoRR},
14
+ volume = {abs/1511.04136},
15
+ year = {2015}
16
+ }
17
+
18
+ Enquiries, Questions and Comments
19
+ --------------------------------
20
+
21
+ If you have any further enquiries, questions, or comments, please find the information on the website: [DETRAC homepage](http://detrac-db.rit.albany.edu/),
22
+ or contact us: ua.detrack@gmail.com or lywen.cv.workbox@gmail.com. Besides, the QQ Group (387090533) is available to facilitate discussion.
23
+ If you find any bug in the toolkit, please inform us.
24
+
25
+ You can also subscribe to the DETRAC [mailing list](http://detrac-db.rit.albany.edu/auth/register/) to receive news about the benchmark and important software updates.
26
+
27
+ Platform Support
28
+ ----------------
29
+
30
+ The toolkit is written in Matlab with executable binaries as well as support for multiple versions of Matlab (at the moment it was tested with versions from 2013 to 2015).
31
+
32
+ The code should be run on Windows system. However, it is hard to verify this on all versions and system configurations.
33
+ If you find there exists some problems to run it on your computer, please contact us as soon as possible.
34
+
35
+ Tracker Modules
36
+ -------
37
+
38
+ The tracker module contains several tracking related functions. For the proposed tracker, you should create a main function like below:
39
+
40
+ [stateInfo, speed] = run_tracker(curSequence, baselinedetections);
41
+
42
+ **Input**: There are two input variables available for the tracker:
43
+
44
+ * 'curSequence' - A cell containing the sequence information.
45
+
46
+ * 'baselinedetections' - A matrix containing comma-separated values that denote the detection bounding box and the detection score of the object.
47
+
48
+ **Output**: the results file will be produced after execution.
49
+
50
+ * 'stateInfo' - A struct containing the trajectory positions of the tacker (i.e., LX, LY, W, H).
51
+
52
+ * 'speed' - A variable indicating the running speed of the tracker. This is an additional measure.
53
+
54
+ If you want to submit the tracking results for comparison, you should put the code of the tracker into the path 'trackers/' of the toolkit at first.
55
+
56
+ How to run your code
57
+ -------
58
+
59
+ 1. Open the 'initialize_enviroment.m' function, and set the parameters as follows:
60
+ a) make sure the images, detections and annotations are in the right path.
61
+ b) select the evaluation type, i.e., Detection and Tracking.
62
+ c) select the sequences for evaluation, i.e., DETRAC-Train, DETRAC-Test, and DETRAC-Free.
63
+ d) if you chose 'DETRAC-Free', edit the 'sequences.txt' file to select the evaluated sequences you want.
64
+ 2. Open the 'DETRAC_experiment.m' function, and input the name of the tracker if you chose 'Tracking'.
65
+ 3. Run the 'DETRAC_experiment.m' function for evaluation.
66
+
67
+ More details are presented on the website http://detrac-db.rit.albany.edu/instructions.
68
+
69
+ To ease your first encounter with the code, we provide several source codes of state-of-the-art trackers in the toolkit, including CEM, CMOT, DCT, FH2T, GOG, H2T, IHTILS and RMOT.
70
+ Specifically, the FH2T and RMOT methods are not included in the arXiv paper due to the time issue.
71
+ If you have any further questions about the trackers, please contact to the original authors of the tracker.
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/AP_DET_EVAL.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40d310fb9e8cac4fb85b58008a7680fc0ba56cd44b7b57b77519d4c4097f50d1
3
+ size 310444032
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/CLEAR_MOT.m ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function [metrics, metricsInfo] = CLEAR_MOT(gtInfo,stateInfo)
2
+ % compute CLEAR MOT and other metrics
3
+ %
4
+ % metrics contains the following
5
+ % [1] recall - recall = percentage of detected targets
6
+ % [2] precision - precision = percentage of correctly detected targets
7
+ % [3] FAR - number of false alarms per frame
8
+ % [4] GT - number of ground truth trajectories
9
+ % [5-7] MT, PT, ML - number of mostly tracked, partially tracked and mostly lost trajectories
10
+ % [8] falsepositives- number of false positives (FP)
11
+ % [9] missed - number of missed targets (FN)
12
+ % [10] idswitches - number of id switches (IDs)
13
+ % [11] FRA - number of fragmentations
14
+ % [12] MOTA - Multi-object tracking accuracy in [0,100]
15
+ % [13] MOTP - Multi-object tracking precision in [0,100] (3D) / [td,100] (2D)
16
+ % [14] MOTAL - Multi-object tracking accuracy in [0,100] with log10(idswitches)
17
+ %
18
+ %
19
+ % (C) Anton Andriyenko, 2012
20
+ %
21
+ % The code may be used free of charge for non-commercial and
22
+ % educational purposes, the only requirement is that this text is
23
+ % preserved within the derivative work. For any other purpose you
24
+ % must contact the authors for permission. This code may not be
25
+ % redistributed without written permission from the authors.
26
+
27
+
28
+ % default options: 2D
29
+ options.eval3d = false; % only bounding box overlap
30
+ options.td = 0.7; % threshold 70%
31
+
32
+ td = options.td;
33
+
34
+ assert(length(gtInfo.frameNums)==length(stateInfo.frameNums), ...
35
+ 'Ground Truth and state must be of equal length');
36
+ if(gtInfo.frameNums(1)~=stateInfo.frameNums(1))
37
+ gtInfo.frameNums = gtInfo.frameNums + stateInfo.frameNums(1) - gtInfo.frameNums(1);
38
+ end
39
+ assert(all(gtInfo.frameNums==stateInfo.frameNums), ...
40
+ 'Ground Truth and state must contain equal frame numbers');
41
+
42
+ % check if all necessery info is available
43
+ if options.eval3d
44
+ assert(all(isfield(gtInfo,{'Xgp','Ygp'})), ...
45
+ 'Ground Truth Ground Plane coordinates needed for 3D evaluation');
46
+ assert(all(isfield(stateInfo,{'Xgp','Ygp'})), ...
47
+ 'Ground Plane coordinates needed for 3D evaluation');
48
+ else
49
+ assert(all(isfield(gtInfo,{'X','Y','W','H'})), ...
50
+ 'Ground Truth coordinates X,Y,W,H needed for 2D evaluation');
51
+ assert(all(isfield(stateInfo,{'Xi','Yi','W','H'})), ...
52
+ 'State coordinates Xi,Yi,W,H needed for 2D evaluation');
53
+
54
+ end
55
+
56
+ gtInd=~~gtInfo.X;
57
+ stInd=~~stateInfo.X;
58
+
59
+ [Fgt, Ngt]=size(gtInfo.X);
60
+ [F, N]=size(stateInfo.X);
61
+
62
+ aspectRatio=mean(gtInfo.W(~~gtInfo.W)./gtInfo.H(~~gtInfo.H));
63
+
64
+
65
+ metricsInfo.names.long = {'Recall','Precision','False Alarm Rate', ...
66
+ 'GT Tracks','Mostly Tracked','Partially Tracked','Mostly Lost', ...
67
+ 'False Positives', 'False Negatives', 'ID Switches', 'Fragmentations', ...
68
+ 'MOTA','MOTP', 'MOTA Log'};
69
+
70
+ metricsInfo.names.short = {'Rcll','Prcn','FAR', ...
71
+ 'GT','MT','PT','ML', ...
72
+ 'FP', 'FN', 'IDs', 'FM', ...
73
+ 'MOTA','MOTP', 'MOTAL'};
74
+
75
+ metricsInfo.widths.long = [6 9 16 9 14 17 11 15 15 11 14 5 5 8];
76
+ metricsInfo.widths.short = [5 5 5 3 3 3 3 4 4 3 3 5 5 5];
77
+
78
+ metricsInfo.format.long = {'.1f','.1f','.2f', ...
79
+ 'i','i','i','i', ...
80
+ 'i','i','i','i', ...
81
+ '.1f','.1f','.1f'};
82
+
83
+ metricsInfo.format.short=metricsInfo.format.long;
84
+
85
+
86
+ metrics=zeros(1,14);
87
+ metrics(9)=numel(find(gtInd)); % False Negatives (missed)
88
+ metrics(7)=Ngt; % Mostly Lost
89
+
90
+ % nothing to be done, if state is empty
91
+ if ~N, return; end
92
+
93
+ % mapping
94
+ M=zeros(F,Ngt);
95
+
96
+ mme=zeros(1,F); % ID Switchtes (mismatches)
97
+ c=zeros(1,F); % matches found
98
+ fp=zeros(1,F); % false positives
99
+ m=zeros(1,F); % misses = false negatives
100
+ g=zeros(1,F);
101
+ d=zeros(F,Ngt); % all distances;
102
+ ious=Inf*ones(F,Ngt); % all overlaps
103
+
104
+ matched=@matched2d;
105
+ if options.eval3d, matched=@matched3d; end
106
+
107
+ alltracked=zeros(F,Ngt);
108
+ allfalsepos=zeros(F,N);
109
+
110
+ for t=1:F
111
+ g(t)=numel(find(gtInd(t,:)));
112
+
113
+ % mapping for current frame
114
+ if t>1
115
+ mappings=find(M(t-1,:));
116
+ for map=mappings
117
+ if gtInd(t,map) && stInd(t,M(t-1,map)) && matched(gtInfo,stateInfo,t,map,M(t-1,map),td*0.8)
118
+ M(t,map)=M(t-1,map);
119
+ end
120
+ end
121
+ end
122
+
123
+ GTsNotMapped=find(~M(t,:) & gtInd(t,:));
124
+ EsNotMapped=setdiff(find(stInd(t,:)),M(t,:));
125
+
126
+ if options.eval3d
127
+ cost = zeros(numel(GTsNotMapped), numel(EsNotMapped));
128
+ for o = 1:numel(GTsNotMapped)
129
+ GT = [gtInfo.Xgp(t,GTsNotMapped(o)), gtInfo.Ygp(t,GTsNotMapped(o))];
130
+ for e = 1:numel(EsNotMapped)
131
+ E = [stateInfo.Xgp(t,EsNotMapped(e)), stateInfo.Ygp(t,EsNotMapped(e))];
132
+ cost(o,e)=norm(GT-E);
133
+ end
134
+ end
135
+ cost(cost > td) = Inf;
136
+ assignLabel = munkres(cost);
137
+ for i = 1:numel(assignLabel)
138
+ if(assignLabel(i))
139
+ M(t, GTsNotMapped(i)) = EsNotMapped(assignLabel(i));
140
+ end
141
+ end
142
+
143
+ else
144
+ allisects=zeros(Ngt,N); maxisect=Inf;
145
+ while maxisect > td && numel(GTsNotMapped)>0 && numel(EsNotMapped)>0
146
+ for o=GTsNotMapped
147
+ GT=[gtInfo.X(t,o)-gtInfo.W(t,o)/2 ...
148
+ gtInfo.Y(t,o)-gtInfo.H(t,o) ...
149
+ gtInfo.W(t,o) gtInfo.H(t,o) ];
150
+ for e=EsNotMapped
151
+ E=[stateInfo.Xi(t,e)-stateInfo.W(t,e)/2 ...
152
+ stateInfo.Yi(t,e)-stateInfo.H(t,e) ...
153
+ stateInfo.W(t,e) stateInfo.H(t,e) ];
154
+ allisects(o,e)=boxiou(GT(1),GT(2),GT(3),GT(4),E(1),E(2),E(3),E(4));
155
+ end
156
+ end
157
+ [maxisect, cind]=max(allisects(:));
158
+
159
+ if maxisect >= td
160
+ [u, v]=ind2sub(size(allisects),cind);
161
+ M(t,u)=v;
162
+ allisects(:,v)=0;
163
+ GTsNotMapped=find(~M(t,:) & gtInd(t,:));
164
+ EsNotMapped=setdiff(find(stInd(t,:)),M(t,:));
165
+ end
166
+
167
+ end
168
+ end
169
+
170
+ curtracked=find(M(t,:));
171
+
172
+
173
+ alltrackers=find(stInd(t,:));
174
+ mappedtrackers=intersect(M(t,find(M(t,:))),alltrackers);
175
+ falsepositives=setdiff(alltrackers,mappedtrackers);
176
+
177
+ alltracked(t,:)=M(t,:);
178
+ allfalsepos(t,1:length(falsepositives))=falsepositives;
179
+
180
+ %% mismatch errors
181
+ if t>1
182
+ for ct=curtracked
183
+ lastnotempty=find(M(1:t-1,ct),1,'last');
184
+ if gtInd(t-1,ct) && ~isempty(lastnotempty) && M(t,ct)~=M(lastnotempty,ct)
185
+ mme(t)=mme(t)+1;
186
+ end
187
+ end
188
+ end
189
+
190
+ c(t)=numel(curtracked);
191
+ for ct=curtracked
192
+ eid=M(t,ct);
193
+ if options.eval3d
194
+ d(t,ct)=norm([gtInfo.Xgp(t,ct) gtInfo.Ygp(t,ct)] - ...
195
+ [stateInfo.Xgp(t,eid) stateInfo.Ygp(t,eid)]);
196
+ else
197
+ gtLeft=gtInfo.X(t,ct)-gtInfo.W(t,ct)/2;
198
+ gtTop=gtInfo.Y(t,ct)-gtInfo.H(t,ct);
199
+ gtWidth=gtInfo.W(t,ct); gtHeight=gtInfo.H(t,ct);
200
+
201
+ stLeft=stateInfo.Xi(t,eid)-stateInfo.W(t,eid)/2;
202
+ stTop=stateInfo.Yi(t,eid)-stateInfo.H(t,eid);
203
+ stWidth=stateInfo.W(t,eid); stHeight=stateInfo.H(t,eid);
204
+ ious(t,ct)=boxiou(gtLeft,gtTop,gtWidth,gtHeight,stLeft,stTop,stWidth,stHeight);
205
+ end
206
+ end
207
+
208
+
209
+ fp(t)=numel(find(stInd(t,:)))-c(t);
210
+ m(t)=g(t)-c(t);
211
+
212
+
213
+ end
214
+
215
+ missed=sum(m);
216
+ falsepositives=sum(fp);
217
+ idswitches=sum(mme);
218
+
219
+ if options.eval3d
220
+ MOTP=(1-sum(sum(d))/sum(c)/td) * 100; % avg distance to [0,100]
221
+ else
222
+ MOTP=sum(ious(ious>=td & ious<Inf))/sum(c) * 100; % avg ol
223
+ end
224
+
225
+ MOTAL=(1-((sum(m)+sum(fp)+log10(sum(mme)+1))/sum(g)))*100;
226
+ MOTA=(1-((sum(m)+sum(fp)+(sum(mme)))/sum(g)))*100;
227
+ recall=sum(c)/sum(g)*100;
228
+ precision=sum(c)/(sum(fp)+sum(c))*100;
229
+ FAR=sum(fp)/Fgt;
230
+
231
+
232
+ %% MT PT ML
233
+ MTstatsa=zeros(1,Ngt);
234
+ for i=1:Ngt
235
+ gtframes=find(gtInd(:,i));
236
+ gtlength=length(gtframes);
237
+ gttotallength=numel(find(gtInd(:,i)));
238
+ trlengtha=numel(find(alltracked(gtframes,i)>0));
239
+ if(gtlength/gttotallength >= 0.8 && trlengtha/gttotallength < 0.2)
240
+ MTstatsa(i)=3;
241
+ elseif(t>=find(gtInd(:,i),1,'last') && trlengtha/gttotallength <= 0.8)
242
+ MTstatsa(i)=2;
243
+ elseif trlengtha/gttotallength >= 0.8
244
+ MTstatsa(i)=1;
245
+ end
246
+ end
247
+ % MTstatsa
248
+ MT=numel(find(MTstatsa==1));PT=numel(find(MTstatsa==2));ML=numel(find(MTstatsa==3));
249
+
250
+ %% fragments
251
+ fr=zeros(1,Ngt);
252
+ for i=1:Ngt
253
+ b=alltracked(find(alltracked(:,i),1,'first'):find(alltracked(:,i),1,'last'),i);
254
+ b(~~b)=1;
255
+ fr(i)=numel(find(diff(b)==-1));
256
+ end
257
+ FRA=sum(fr);
258
+
259
+ assert(Ngt==MT+PT+ML,'Hmm... Not all tracks classified correctly.');
260
+ metrics=[recall, precision, FAR, Ngt, MT, PT, ML, falsepositives, missed, idswitches, FRA, MOTA, MOTP, MOTAL];
261
+ end
262
+
263
+ function ret=matched2d(gtInfo,stateInfo,t,map,mID,td)
264
+ gtLeft=gtInfo.X(t,map)-gtInfo.W(t,map)/2;
265
+ gtTop=gtInfo.Y(t,map)-gtInfo.H(t,map);
266
+ gtWidth=gtInfo.W(t,map); gtHeight=gtInfo.H(t,map);
267
+
268
+ stLeft=stateInfo.Xi(t,mID)-stateInfo.W(t,mID)/2;
269
+ stTop=stateInfo.Yi(t,mID)-stateInfo.H(t,mID);
270
+ stWidth=stateInfo.W(t,mID); stHeight=stateInfo.H(t,mID);
271
+
272
+ ret = boxiou(gtLeft,gtTop,gtWidth,gtHeight,stLeft,stTop,stWidth,stHeight) >= td;
273
+ end
274
+
275
+
276
+ function ret=matched3d(gtInfo,stateInfo,t,map,mID,td)
277
+ Xgt=gtInfo.Xgp(t,map); Ygt=gtInfo.Ygp(t,map);
278
+ X=stateInfo.Xgp(t,mID); Y=stateInfo.Ygp(t,mID);
279
+ ret=norm([Xgt Ygt]-[X Y])<=td;
280
+
281
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/CLEAR_MOT_EVAL.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:116e6ff15e8f438d7bf7c10652e29bc7e65f4457faa17b1896e12ceb3bb44d34
3
+ size 310567424
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/DETRAC_DET_EVAL.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a21b9611ed7aa4ceb89afc831d7d5935d9d77027bffae9cd63deff01e4cedfce
3
+ size 310440448
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/DETRAC_MOT_EVAL.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:abb2e0c81c923a5fbd2709e218a5ce0a52a2e250c66d37aae56ef058f5da3e9f
3
+ size 310592000
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/README_evaluation.txt ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ==============================================
2
+ trainlist (60 sequences) Detection evaluation to calculate AP score
3
+ reference: M. Everingham, S. M. A. Eslami, L. J. V. Gool, C. K. I. Williams, J. M. Winn, and A. Zisserman. The pascal visual object classes challenge: A retrospective. IJCV, 111(1):98�C136, 2015.
4
+ ==============================================
5
+
6
+ Command parameters:
7
+
8
+ Input_1: Detector name
9
+
10
+ Input_2: Detection result folder Path
11
+ Detection file is named as "SequenceName_Det_DetectorName.txt"
12
+
13
+ Input_3: path of a txt file contains which sequences will be evaluated.
14
+ For example:
15
+ *******************
16
+ MVI_39501
17
+ MVI_39511
18
+ *******************
19
+
20
+ Input_4: Output Path
21
+
22
+
23
+ For example:
24
+ - Command line: AP_DET_EVAL.exe name C:/Detections/ C:/sqList.txt C:/PRCurve/
25
+
26
+ The output file is named as "name_detection_PR.txt"
27
+ The format of this file is as following:
28
+
29
+ ***************************************
30
+ // left is recall, right is precision
31
+ 0.000001581602796 1.000000000000000
32
+ 0.000003163205593 1.000000000000000
33
+ 0.000004744808389 1.000000000000000
34
+ 0.000006326411185 1.000000000000000
35
+ 0.000007908013981 1.000000000000000
36
+ 0.000009489616778 1.000000000000000
37
+ 0.000011071219574 1.000000000000000
38
+ 0.000012652822370 1.000000000000000
39
+ 0.000014234425166 1.000000000000000
40
+ 0.000015816027963 1.000000000000000
41
+ 0.000017397630759 1.000000000000000
42
+ 0.000018979233555 1.000000000000000
43
+ 0.000020560836352 1.000000000000000
44
+ 0.000022142439148 1.000000000000000
45
+ 0.000023724041944 1.000000000000000
46
+ 0.000025305644740 1.000000000000000
47
+ 0.000026887247537 1.000000000000000
48
+ 0.000026887247537 0.944444444444444
49
+ 0.000026887247537 0.894736842105263
50
+ 0.000028468850333 0.900000000000000
51
+ ......
52
+ *****************************************
53
+
54
+ ==============================================
55
+ trainlist (60 sequences) CLEAR MOT evaluation
56
+ ==============================================
57
+
58
+ threshold = 0:0.1:1
59
+
60
+ Command parameters:
61
+
62
+ Input_1: tracker name
63
+
64
+ Input_2: detector name
65
+
66
+ Input_3: Tracking result folder Path
67
+ There are N <= 11 folders under Input_1 path, which takes threshold value as name
68
+ *****
69
+ 0.0
70
+ 0.1
71
+ 0.2
72
+ ...
73
+ 1.0
74
+ *****
75
+ Tracking file under each threshold folder is named as
76
+ "SequenceName_LX.txt"
77
+ "SequenceName_LY.txt"
78
+ "SequenceName_H.txt"
79
+ "SequenceName_W.txt"
80
+
81
+ Input_4: path of a txt file contains which threshold will be evaluated
82
+ For example:
83
+ *******************
84
+ 0.0
85
+ 0.3
86
+ 0.6
87
+ 1.0
88
+ *******************
89
+
90
+ Input_5: path of a txt file contains which sequences will be evaluated.
91
+ For example:
92
+ *******************
93
+ MVI_39501
94
+ MVI_39511
95
+ *******************
96
+
97
+ Input_6: Output Path
98
+ tracking indicators of each threshold in one file named as "DETRAC_MOT_Result.txt"
99
+ ********
100
+ metrics contains the following
101
+ [1] recall - recall = percentage of detected targets
102
+ [2] precision - precision = percentage of correctly detected targets
103
+ [3] FAR - number of false alarms per frame
104
+ [4] GT - number of ground truth trajectories
105
+ [5-7] MT, PT, ML - number of mostly tracked, partially tracked and mostly lost trajectories (*100)
106
+ [8] falsepositives- number of false positives (FP)
107
+ [9] missed - number of missed targets (FN)
108
+ [10] idswitches - number of id switches (IDs)
109
+ [11] FRA - number of fragmentations
110
+ [12] MOTA - Multi-object tracking accuracy in [0,100]
111
+ [13] MOTP - Multi-object tracking precision in [0,100] (3D) / [td,100] (2D)
112
+ [14] MOTAL - Multi-object tracking accuracy in [0,100] with log10(idswitches)
113
+ ********
114
+
115
+ For example:
116
+ - Command line: exeName.exe CEM ACF C:/TrackerResult/ C:/thresh.txt C:/sequences.txt C:/output/
117
+
118
+
119
+ ==============================================
120
+ trainlist (60 sequences) Detection evaluation
121
+ ==============================================
122
+
123
+ threshold = 0:step:1
124
+
125
+ Command parameters:
126
+
127
+ Input_1: Detector name
128
+
129
+ Input_2: Detection result folder Path
130
+ Detection file is named as "SequenceName_Det_DetectorName.txt"
131
+
132
+ Input_3: path of a txt file contains which sequences will be evaluated.
133
+ For example:
134
+ *******************
135
+ MVI_39501
136
+ MVI_39511
137
+ *******************
138
+ Input_4: score step
139
+ For example: 0.1
140
+
141
+ Input_5: Output Path
142
+
143
+
144
+ For example:
145
+ - Command line: DETRAC_DET_EVAL.exe name C:/Detections/ C:/sqList.txt 0.1 C:/PRCurve/
146
+
147
+ The output file is named as "name_detection_PR.txt"
148
+ The format of this file is as following:
149
+
150
+ ***************************************
151
+ // left is recall, right is precision
152
+ 0.5672 0.2926
153
+ 0.5672 0.2926
154
+ 0.5672 0.2927
155
+ 0.5672 0.2944
156
+ 0.5672 0.3094
157
+ 0.5666 0.3752
158
+ 0.5573 0.5571
159
+ 0.4644 0.7976
160
+ 0.1008 0.9430
161
+ *****************************************
162
+
163
+ The other output file is named as "name_thres.txt"
164
+ Since the maximal score value may be less than 1, we create this file to record what the actual scores are used. The next TRACK SYSTEM evaluation phase will reply on this file.
165
+ For example:
166
+ ************
167
+ 0.0
168
+ 0.1
169
+ 0.2
170
+ 0.3
171
+ 0.4
172
+ 0.5
173
+ 0.6
174
+ 0.7
175
+ 0.8
176
+ ************
177
+
178
+ ==============================================
179
+ trainlist (60 sequences) DETRAC MOT evaluation
180
+ ==============================================
181
+
182
+ Command parameters:
183
+
184
+ Input_1: tracker name
185
+
186
+ Input_2: detector name
187
+
188
+ Input_3: "detectorname_thres.txt" file which is generated by detection evaluation phase.
189
+
190
+ Input_4: detectorName_detection_PR.txt path
191
+
192
+ Input_5: path of a txt file contains which sequences will be evaluated.
193
+ For example:
194
+ *******************
195
+ MVI_39501
196
+ MVI_39511
197
+ *******************
198
+
199
+ Input_6: Tracking result folder Path
200
+ There are N folders under Input_1 path, which takes threshold value as name.
201
+ These names should be consistent with "detectorname_thres.txt" file
202
+ *****
203
+ 0.0
204
+ 0.2
205
+ 0.4
206
+ ...
207
+ 1.0
208
+ *****
209
+ Tracking file under each threshold folder is named as
210
+ "SequenceName_LX.txt"
211
+ "SequenceName_LY.txt"
212
+ "SequenceName_H.txt"
213
+ "SequenceName_W.txt"
214
+
215
+ Input_7: Output Path
216
+
217
+ final average score (13 indicators) in one file named as "trackerName_detectorName_averageScore.txt"
218
+ ********
219
+ scoreRECALL
220
+ scorePRECISION
221
+ scoreFAR
222
+ scoreMT
223
+ scorePT
224
+ scoreML
225
+ scoreFP
226
+ scoreFN
227
+ scoreIDS
228
+ scoreFM
229
+ scoreMOTA
230
+ scoreMOTP
231
+ scoreMOTAL
232
+ *********
233
+
234
+ For example:
235
+ - Command line: exeName.exe TrackerName detectorName C:/detectorname_thres.txt C:/detectorname_detection_PR.txt C:/seqList.txt C:/TrackerName/ C:/output/
236
+
237
+
238
+
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/VOCap.m ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ function ap = VOCap(rec,prec)
2
+ mrec=[0 ; rec ; 1];
3
+ mpre=[0 ; prec ; 0];
4
+ for i=numel(mpre)-1:-1:1
5
+ mpre(i)=max(mpre(i),mpre(i+1));
6
+ end
7
+ i=find(mrec(2:end)~=mrec(1:end-1))+1;
8
+ ap=sum((mrec(i)-mrec(i-1)).*mpre(i));
9
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/boxIntersect.m ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function isect=boxIntersect(bboxleft1, bboxright1, bboxbottom1, bboxup1, bboxleft2, bboxright2, bboxbottom2, bboxup2)
2
+ % A=[bboxleft1 bboxbottom1 abs(bboxright1-bboxleft1) abs(bboxbottom1-bboxup1)];
3
+ % B=[bboxleft2 bboxbottom2 abs(bboxright2-bboxleft2) abs(bboxbottom2-bboxup2)];
4
+ %
5
+ % (C) Anton Andriyenko, 2012
6
+ %
7
+ % The code may be used free of charge for non-commercial and
8
+ % educational purposes, the only requirement is that this text is
9
+ % preserved within the derivative work. For any other purpose you
10
+ % must contact the authors for permission. This code may not be
11
+ % redistributed without written permission from the authors.
12
+
13
+ % isect=rectint(A,B);
14
+ isect=0;
15
+
16
+ hor= max(0,min(bboxright1,bboxright2) - max(bboxleft1,bboxleft2));
17
+
18
+ if ~hor, return; end
19
+ ver= max(0,min(bboxbottom1,bboxbottom2) - max(bboxup1,bboxup2));
20
+ if ~ver, return; end
21
+
22
+ isect = hor*ver;
23
+
24
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/boxUnion.m ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function union=boxUnion(bboxleft1, bboxright1, bboxbottom1, bboxup1, bboxleft2, bboxright2, bboxbottom2, bboxup2,isect)
2
+ %
3
+ % (C) Anton Andriyenko, 2012
4
+ %
5
+ % The code may be used free of charge for non-commercial and
6
+ % educational purposes, the only requirement is that this text is
7
+ % preserved within the derivative work. For any other purpose you
8
+ % must contact the authors for permission. This code may not be
9
+ % redistributed without written permission from the authors.
10
+
11
+ a1=bboxright1-bboxleft1;
12
+ b1=bboxbottom1-bboxup1;
13
+ a2=bboxright2-bboxleft2;
14
+ b2=bboxbottom2-bboxup2;
15
+ union=a1*b1+a2*b2;
16
+ if nargin>8
17
+ bisect=isect;
18
+ else
19
+ bisect=boxIntersect(bboxleft1, bboxright1, bboxbottom1, bboxup1, bboxleft2, bboxright2, bboxbottom2, bboxup2);
20
+ end
21
+ union=union-bisect;
22
+
23
+
24
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/boxiou.m ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function iou=boxiou(x1,y1,w1,h1,x2,y2,w2,h2)
2
+ % compute intersection over union of two bboxes
3
+ %
4
+ % (C) Anton Andriyenko, 2012
5
+ %
6
+ % The code may be used free of charge for non-commercial and
7
+ % educational purposes, the only requirement is that this text is
8
+ % preserved within the derivative work. For any other purpose you
9
+ % must contact the authors for permission. This code may not be
10
+ % redistributed without written permission from the authors.
11
+
12
+ bisect=boxIntersect(x1,x1+w1,y1+h1,y1,x2,x2+w2,y2+h2,y2);
13
+ iou=0;
14
+ if ~bisect, return; end
15
+
16
+ bunion=boxUnion(x1,x1+w1,y1+h1,y1,x2,x2+w2,y2+h2,y2,bisect);
17
+
18
+ assert(bunion>0,'something wrong with union computation');
19
+ iou=bisect/bunion;
20
+
21
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/checkResultFormat.m ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function [errorMsg, realList] = checkResultFormat(unzipPath, detectorName)
2
+ %% Check detection format
3
+ global options
4
+
5
+ errorMsg = [];
6
+ HEIGHT = 540;
7
+ WIDTH = 960;
8
+
9
+ resList = dir(fullfile(unzipPath, '*.txt'));
10
+ optionID = find(ismember({'DETRAC-Test','DETRAC-Train','DETRAC-Free','DETRAC-Test-Beginner','DETRAC-Test-Experienced'},options.evaluateSeqs));
11
+ if(optionID == 1)
12
+ listPath = 'seqs/testlist-full.txt';
13
+ elseif(optionID == 2)
14
+ listPath = 'seqs/trainlist-full.txt';
15
+ elseif(optionID == 3)
16
+ listPath = '../sequences.txt';
17
+ elseif(optionID == 4)
18
+ listPath = 'seqs/testlist-det-beginner.txt';
19
+ elseif(optionID == 5)
20
+ listPath = 'seqs/testlist-det-experienced.txt';
21
+ else
22
+ error('error in sequences for evaluation!');
23
+ end
24
+ realList = importdata(listPath);
25
+
26
+ %% Check number
27
+ if(length(resList) < length(realList))
28
+ errorMsg = sprintf('Results must be %d txt files!', length(realList));
29
+ return;
30
+ end
31
+
32
+ %% Check list
33
+ for i = 1:length(realList)
34
+ fprintf('Checking %d/%d\n', i, length(realList));
35
+ resName = [realList{i} '_Det_' detectorName '.txt'];
36
+ if(~exist([unzipPath resName], 'file'))
37
+ errorMsg = sprintf('Sequence %s is not valid', resName);
38
+ end
39
+ %% Check ext
40
+ [~, namePart, nameExt] = fileparts(resName);
41
+ if(~strcmp(nameExt, '.txt'))
42
+ errorMsg = sprintf('%s must be txt file', resName);
43
+ return;
44
+ end
45
+ %% Check resName format
46
+ pos = strfind(namePart, '_');
47
+ if(length(pos) ~= 3)
48
+ errorMsg = sprintf('%s must be MVI_XXX_Det_DetectorName.txt', resName);
49
+ return;
50
+ end
51
+ midName = namePart(pos(2)+1:pos(3)-1);
52
+ if(~strcmp(midName, 'Det'))
53
+ errorMsg = sprintf('%s must be MVI_XXX_Det_DetectorName.txt', resName);
54
+ return;
55
+ end
56
+
57
+ %% Check content
58
+ detections = load(fullfile(unzipPath, resName));
59
+ lineCnt = 1;
60
+ while(lineCnt <= size(detections, 1))
61
+ content = detections(lineCnt, :);
62
+ % each line of the file should be set as [Frame, Number, Left, Top, Width, Height, Score]
63
+ if(length(content) ~= 7)
64
+ errorMsg = sprintf('Content must be [Frame, Number, Left, Top, Width, Height, Score] (Line %d in %s)', lineCnt, resName);
65
+ return;
66
+ end
67
+ frame = content(1);
68
+ number = content(2);
69
+ left = min(max(content(3), 1), WIDTH);
70
+ top = min(max(content(4), 1), HEIGHT);
71
+ width = min(content(5), WIDTH - left + 1);
72
+ height = min(content(6), HEIGHT - top + 1);
73
+ score = content(7);
74
+ if (score < 0 || score > 1)
75
+ errorMsg = sprintf('Score must be in [0, 1] (Line %d in %s)', lineCnt, resName);
76
+ return;
77
+ end
78
+ if(height <= 0)
79
+ errorMsg = sprintf('Height must be postive (Line %d in %s)', lineCnt, resName);
80
+ return;
81
+ end
82
+ if(width <= 0)
83
+ errorMsg = sprintf('Width must be positive (Line %d in %s)', lineCnt, resName);
84
+ return;
85
+ end
86
+ detections(lineCnt, :) = [frame, number, left, top, width, height, score];
87
+ lineCnt = lineCnt + 1;
88
+ end
89
+ dlmwrite(fullfile(unzipPath, resName), detections);
90
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/createIntImg.m ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function intImg = createIntImg(img)
2
+
3
+ [height, width] = size(img);
4
+ intImg = img;
5
+ for i = 2:height
6
+ intImg(i, 1) = intImg(i, 1) + intImg(i-1, 1);
7
+ end
8
+ for j = 2:width
9
+ intImg(1, j) = intImg(1, j) + intImg(1, j-1);
10
+ end
11
+
12
+ for i = 2:height
13
+ for j = 2:width
14
+ intImg(i, j) = intImg(i, j) + intImg(i-1, j) + intImg(i, j-1) - intImg(i-1, j-1);
15
+ end
16
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/createNewPath.m ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function createNewPath(filePath)
2
+ % create new folder for saving results
3
+ if(~isdir(filePath))
4
+ mkdir(filePath);
5
+ elseif(isdir(filePath))
6
+ Dirs = dir(filePath);
7
+ for i = 1:length(Dirs)
8
+ % remove directory and all contents
9
+ if(Dirs(i).isdir && ~strcmp(Dirs(i).name,'.') && ~strcmp(Dirs(i).name,'..'))
10
+ rmdir([filePath Dirs(i).name],'s');
11
+ % delete the files in corresponding directory
12
+ elseif(~strcmp(Dirs(i).name,'.') && ~strcmp(Dirs(i).name,'..'))
13
+ delete([filePath Dirs(i).name]);
14
+ end
15
+ end
16
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/createPath.m ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ function createPath(newPath)
2
+
3
+ if(~isdir(newPath))
4
+ mkdir(newPath);
5
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/ACF_detection_PR.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0.567181741977320,0.292586135014274
2
+ 0.562226580416594,0.345369012885794
3
+ 0.548566277065178,0.444164705219456
4
+ 0.522548911066475,0.553060066388902
5
+ 0.484410141237130,0.647648168354098
6
+ 0.437192971357173,0.728205776667826
7
+ 0.378966264412355,0.795026295270169
8
+ 0.312682872823319,0.851369857114558
9
+ 0.244322836762775,0.893871622911833
10
+ 0.185887358248849,0.920721341783456
11
+ 0.134227466114160,0.941628110818937
12
+ 0.091119300298923,0.954520602415627
13
+ 0.058218798930837,0.958568787271165
14
+ 0.031815521849843,0.953093906945892
15
+ 0.016206683853417,0.962792445738983
16
+ 0.007136191816787,0.989256741942556
17
+ 0.002103531719044,0.994764397905759
18
+ 0.000434940768975,0.996376811594203
19
+ 0.000080661742610,1.000000000000000
20
+ 0.000017397630759,1.000000000000000
21
+ 0.000001581602796,1.000000000000000
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/DPM_detection_PR.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0.422645388837047,0.171554399987160
2
+ 0.415246650956079,0.237891713367976
3
+ 0.394445410979487,0.302024712169708
4
+ 0.370944375029655,0.367771374808891
5
+ 0.341437993262372,0.433240215615681
6
+ 0.311128157274582,0.498839860123900
7
+ 0.272609802774131,0.560962432834412
8
+ 0.229414648805099,0.622853535895707
9
+ 0.182589716418619,0.674086054781243
10
+ 0.139011814572888,0.716406109906591
11
+ 0.101371249624369,0.747025023601674
12
+ 0.067721068530849,0.787254775781868
13
+ 0.039087731507109,0.810162268480577
14
+ 0.021044806807218,0.845147357723577
15
+ 0.009922975943821,0.871509931934991
16
+ 0.003791101902668,0.882872928176796
17
+ 0.001129264396539,0.871794871794872
18
+ 0.000355860629162,0.925925925925926
19
+ 0.000093314564980,0.921875000000000
20
+ 0.000014234425166,1.000000000000000
21
+ 0.000001581602796,1.000000000000000
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/R-CNN_detection_PR.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0.566832207759343,0.292402245940614
2
+ 0.566832207759343,0.292403677329661
3
+ 0.566832207759343,0.292412981700068
4
+ 0.566832207759343,0.292437557628128
5
+ 0.566832207759343,0.292531127105681
6
+ 0.566832207759343,0.292874408965581
7
+ 0.566832207759343,0.294199591196776
8
+ 0.566832207759343,0.298166198551728
9
+ 0.566825881348158,0.309192601884556
10
+ 0.566723077166400,0.332688979506949
11
+ 0.566239106710741,0.374961641462620
12
+ 0.563869865721923,0.450425956364583
13
+ 0.557034178436427,0.556861554613212
14
+ 0.534999288278742,0.680253065788257
15
+ 0.464336438546823,0.797504149338143
16
+ 0.296091859490408,0.897902607711382
17
+ 0.100811362234488,0.942927305541584
18
+ 0.014395748651684,0.969638862256312
19
+ 0.000778148575767,0.984000000000000
20
+ 0.000074335331425,0.979166666666667
21
+ 0.000001581602796,1.000000000000000
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/README_curve.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ The Precision-Recall curve is generated by tuning the threshold (i.e., 0:0.05:1) of an detector to generate different precision and recall values.
2
+ In the Precision-Recall result file, the first column is for recall and the second column is for precision.
3
+ The raw result is interpolated linearly with the step 0.0001 to calculate the corresponding AP score.
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/curve_results/compACT_detection_PR.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0.614658294715865,0.390629633091797
2
+ 0.607433533142487,0.486536885323780
3
+ 0.590255745172158,0.599103915034065
4
+ 0.559412909042023,0.686765445426709
5
+ 0.514572888164866,0.755913616245164
6
+ 0.461563888844955,0.816227040966160
7
+ 0.402962342037421,0.859089391747676
8
+ 0.340245464753982,0.891378210174773
9
+ 0.272722096572667,0.918457678848213
10
+ 0.209563952109067,0.935946428949841
11
+ 0.156056747908330,0.950339991909541
12
+ 0.110348427096019,0.967080185737057
13
+ 0.073598304521802,0.976149021417633
14
+ 0.044696095022696,0.978633514561762
15
+ 0.024926060069274,0.982911313458900
16
+ 0.011613709333038,0.995391080384980
17
+ 0.003974567827036,0.997618102421596
18
+ 0.000971104116912,0.996753246753247
19
+ 0.000185047527164,1.000000000000000
20
+ 0.000037958467111,1.000000000000000
21
+ 0.000001581602796,1.000000000000000
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/detectionEvaluation.m ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function detectionEvaluation()
2
+
3
+ global options
4
+
5
+ detectorSet = options.detectorSet; % the detector set
6
+
7
+ % Debug Logs
8
+ curPath = pwd;
9
+ log_path = [curPath '/logs/'];
10
+ createPath(log_path);
11
+
12
+ cd('./evaluation');
13
+ addpath(genpath('.'));
14
+ for idDet = 1:length(detectorSet)
15
+ detectorName = detectorSet{idDet};
16
+ diary([log_path 'DETRAC_' detectorName '_detection_logs.txt']);
17
+ % Check formats
18
+ detPath = [options.detPath detectorName '/'];
19
+ [errorMsg, realList] = checkResultFormat(detPath, detectorName);
20
+ if(~isempty(errorMsg))
21
+ error(errorMsg);
22
+ end
23
+ % pre-processing the detection results
24
+ preProcessDetectionResults(detectorName);
25
+ % obtain detection PR scores
26
+ if(options.printDetectionEval)
27
+ detprFile = [options.detPath detectorName '/' detectorName '_detection_PR.txt'];
28
+ detprLine = ['AP_DET_EVAL.exe ' detectorName ' ' detPath ' ' curPath '/sequences.txt ' detPath];
29
+ evalexe(detprLine);
30
+ if(exist(detprFile, 'file'))
31
+ APscore = showDetectionPRCurve(detprFile, detectorName);
32
+ disp(['The AP score of the detector ' detectorName ' is ' num2str(roundn(APscore,-2)) '%.']);
33
+ else
34
+ error('no detection results!');
35
+ end
36
+ end
37
+ end
38
+ cd('../');
39
+
40
+ %% zip the detection results for DETRAC-Test
41
+ zipDetectionResults(detectorSet, realList);
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/clampBBox.m ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function [bleft bright btop bbottom]= clampBBox(bleft, bright, btop, bbottom, imgWidth, imHeight)
2
+ %
3
+ % (C) Anton Andriyenko, 2012
4
+ %
5
+ % The code may be used free of charge for non-commercial and
6
+ % educational purposes, the only requirement is that this text is
7
+ % preserved within the derivative work. For any other purpose you
8
+ % must contact the authors for permission. This code may not be
9
+ % redistributed without written permission from the authors.
10
+
11
+
12
+ % clamp bounding box to [1, imageDim]
13
+
14
+ bleft=max(1,bleft); bleft=min(imgWidth,bleft);
15
+ bright=max(1,bright); bright=min(imgWidth,bright);
16
+ btop=max(1,btop); btop=min(imHeight,btop);
17
+ bbottom=max(1,bbottom); bbottom=min(imHeight,bbottom);
18
+
19
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/displayBBoxes.m ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function displayBBoxes(sceneInfo, X, Y, W, H)
2
+ % Draw bounding boxes on top of images
3
+ %
4
+ % (C) Anton Andriyenko, 2012
5
+ %
6
+ % The code may be used free of charge for non-commercial and
7
+ % educational purposes, the only requirement is that this text is
8
+ % preserved within the derivative work. For any other purpose you
9
+ % must contact the authors for permission. This code may not be
10
+ % redistributed without written permission from the authors.
11
+ %
12
+ [F, numObjs] = size(X);
13
+ if(F == 0)
14
+ disp('no tracking results!');
15
+ end
16
+ ind=find(W);
17
+ aspectRatio=mean(H(ind)./W(ind));
18
+ frameNums = sceneInfo.frameNums;
19
+
20
+ for t = 1:F
21
+ clf
22
+ im = imread([sceneInfo.imgFolder sprintf(sceneInfo.imgFileFormat,frameNums(t))]);
23
+ im = double(im)/255;
24
+ imshow(im,'Border','tight'), hold on;
25
+
26
+ % frame number
27
+ text(10,20,sprintf('#%04d',t),'FontSize',30,'color','r');
28
+
29
+ extar=find(X(t,:));
30
+ % foot position
31
+ if(sceneInfo.displayDots)
32
+ for id=extar
33
+ plot(X(t,id),Y(t,id),'.','color',getColorFromID(id, numObjs),'MarkerSize',sceneInfo.dotSize);
34
+ end
35
+ end
36
+
37
+ % box
38
+ if(sceneInfo.displayBoxes)
39
+ for id=extar
40
+ bleft=X(t,id)-W(t,id)/2;
41
+ btop=Y(t,id)-H(t,id);
42
+ rectangle('Position',[bleft,btop,W(t,id),H(t,id)],'Curvature',[.1,.2*(W(t,id)/H(t,id))],'EdgeColor',getColorFromID(id, numObjs),'linewidth',sceneInfo.boxLineWidth);
43
+ end
44
+ end
45
+
46
+ % ID
47
+ if sceneInfo.displayID
48
+ for id=extar
49
+ tx=X(t,id)-W(t,id)/2;
50
+ ty=Y(t,id)-H(t,id)*0.8; % on top
51
+ text(tx,ty,sprintf('%i',id),'color',getColorFromID(id, numObjs), 'HorizontalAlignment','left', 'FontSize',W(t,id)/5, 'FontUnits','pixels','FontWeight','bold');
52
+ end
53
+ end
54
+
55
+ % cropouts
56
+ if(sceneInfo.displayCropouts)
57
+ bw=2; %border cropouts
58
+
59
+ %% crop outs var sized
60
+ maxTar=30;
61
+ extarRed=extar(extar<=maxTar); % reducde
62
+
63
+ %% crop outs fixed sized
64
+ uniH=min(60,round(sceneInfo.imgHeight/10)); uniW=round(uniH/aspectRatio);
65
+ mxfac=.5;
66
+ crpImg=im(1:uniH,1:min(sceneInfo.imgWidth,round(uniW*size(W,2)+bw*size(W,2))),:)*mxfac;
67
+ crpImg=crpImg + (1-mxfac)*ones(size(crpImg)); % bleeched
68
+ for id=extarRed
69
+ offset=(id-1)*uniW + (id-1)*bw+1;
70
+ bleft=round(X(t,id)-W(t,id)/2);
71
+ bright=round(X(t,id)+W(t,id)/2);
72
+ btop=round(Y(t,id)-H(t,id));
73
+ bbottom=round(Y(t,id));
74
+
75
+ [bleft, bright, btop, bbottom] = clampBBox(bleft, bright, btop, bbottom, sceneInfo.imgWidth, sceneInfo.imgHeight);
76
+ ht=uniH;
77
+ imres=imresize(im(btop:bbottom,bleft:bright,:),[uniH uniW]);
78
+ crpImg(1:ht,offset:offset+uniW-1,:)=imres;
79
+
80
+ end
81
+ imshow(crpImg);
82
+
83
+ for id=extarRed
84
+ tx = id*uniW-uniW/2 + id*bw;
85
+ ty = 30; % top
86
+ text(tx,ty,sprintf('%i',id),'color',getColorFromID(id, numObjs), 'HorizontalAlignment','center', ...
87
+ 'FontSize',uniW/4, 'FontUnits','pixels','FontWeight','bold'); % fixed size
88
+ end
89
+ if(sceneInfo.displayConnections)
90
+ for id=extarRed
91
+ if(t-find(X(:,id),1,'first')<5)
92
+ btop=round(Y(t,id)-H(t,id));
93
+ offset=(id-1)*uniW + (id-1)*bw+1 + uniW/2;
94
+ line([X(t,id) offset],[btop uniH],'color',getColorFromID(id, numObjs),'linestyle','-');
95
+ end
96
+ end
97
+ end
98
+ end
99
+
100
+ % show trace
101
+ if(sceneInfo.traceLength)
102
+ for tracet=max(1,t-sceneInfo.traceLength):max(1,t-1)
103
+ ipolpar=(t-tracet)/sceneInfo.traceLength; % parameter [0,1] for color adjustment
104
+
105
+ extarpast=find(X(tracet,:));
106
+ % foot position
107
+ for id=extarpast
108
+ if(W(tracet+1,id))
109
+ endcol=sceneInfo.grey;
110
+ line(X(tracet:tracet+1,id) ,Y(tracet:tracet+1,id), 'color',ipolpar*endcol + (1-ipolpar)*getColorFromID(id, numObjs),'linewidth',(1-ipolpar)*sceneInfo.traceWidth+1);
111
+ end
112
+ end
113
+ end
114
+ end
115
+ pause(sceneInfo.framePause);
116
+
117
+ % save
118
+ if(~isempty(sceneInfo.outFolder))
119
+ im2save=getframe(gcf);
120
+ im2save=im2save.cdata;
121
+ imwrite(im2save, [sceneInfo.outFolder sprintf('_frame_%04d.jpg',frameNums(t))]);
122
+ end
123
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/displayTrackingResult.m ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function displayTrackingResult(sceneInfo, stateInfo, seqName)
2
+ % Display Tracking Result
3
+ %
4
+ % Take scene information sceneInfo and
5
+ % the tracking result from stateInfo
6
+ %
7
+ %
8
+ % (C) Anton Andriyenko, 2012
9
+ %
10
+ % The code may be used free of charge for non-commercial and
11
+ % educational purposes, the only requirement is that this text is
12
+ % preserved within the derivative work. For any other purpose you
13
+ % must contact the authors for permission. This code may not be
14
+ % redistributed without written permission from the authors.
15
+
16
+ W = stateInfo.W;
17
+ H = stateInfo.H;
18
+ Xi = stateInfo.Xi;
19
+ Yi = stateInfo.Yi;
20
+
21
+ reopenFig(['Tracking Results of Sequence ' seqName]);
22
+ displayBBoxes(sceneInfo, Xi, Yi, W, H);
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/getColorFromID.m ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function col=getColorFromID(id, numObjs)
2
+ % get rgb [0,1] values from id
3
+ global options
4
+ if(~isfield(options,'colors'))
5
+ options.colors = rand(max(1,numObjs-13), 3);
6
+ colors=[
7
+ 128 255 255; %
8
+ 255 0 0; % red 1
9
+ 0 255 0; % green 2
10
+ 0 0 255; % blue 3
11
+ 0 255 255; % cyan 4
12
+ 255 0 255; % magenta 5
13
+ 212 212 0; % yellow 6
14
+ 25 25 25; % black 7
15
+ 34,139,34; % forestgreen 8
16
+ 0,191,255; % deepskyblue 9
17
+ 139,0,0 ; % darkred 10
18
+ 218,112,214; % orchid 11
19
+ 244,164,96 ;]/255; % sandybrown 12
20
+ colors = colors / 255;
21
+ options.colors = cat(1,colors,options.colors);
22
+ end
23
+ col = options.colors(id,:);
24
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/reopenFig.m ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function reopenFig(figname)
2
+ %
3
+ % (C) Anton Andriyenko, 2012
4
+ %
5
+ % The code may be used free of charge for non-commercial and
6
+ % educational purposes, the only requirement is that this text is
7
+ % preserved within the derivative work. For any other purpose you
8
+ % must contact the authors for permission. This code may not be
9
+ % redistributed without written permission from the authors.
10
+
11
+ close(findobj('type','figure','name',figname))
12
+ figure('name',figname);
13
+
14
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/showDetectionPRCurve.m ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function AP = showDetectionPRCurve(detprFile, detectorName)
2
+
3
+ global options
4
+
5
+ % load the PR file
6
+ detResult = load(detprFile);
7
+ rec = detResult(:,1);
8
+ prec = detResult(:,2);
9
+ AP = roundn(VOCap(rec,prec)*100,-2);
10
+
11
+ if(options.showDetectionCurve)
12
+ fontSizeLegend = 14;
13
+ fontSize = 14;
14
+ curFig = figure(1);
15
+ curAxes = axes('Parent',curFig,'FontSize',14);
16
+ if(numel(rec)<100)
17
+ legendName = detectorName;
18
+ else
19
+ legendName = [detectorName ' (' num2str(roundn(AP,-2)) '%)'];
20
+ end
21
+ plot(detResult(:,1),detResult(:,2),'color','r','lineStyle','-','lineWidth',5,'Parent',curAxes);grid on;hold on;
22
+ title(['Detection Curve of ' detectorName],'fontsize',fontSize);
23
+ xlabel('Recall','fontsize',fontSize);
24
+ ylabel('Precision','fontsize',fontSize);
25
+ axis([0 1 0 1]);
26
+ legend(legendName,'Interpreter','none','fontsize',fontSizeLegend,'Location','SouthEast');
27
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/display/showResults.m ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function showResults(stateInfo, curSequence, resultSavePath)
2
+
3
+ global options
4
+
5
+ if(options.showVisualResults)
6
+ sceneInfo.imgFolder = curSequence.imgFolder;
7
+ sceneInfo.imgFileFormat = 'img%05d.jpg';
8
+ if(options.saveVisualResults)
9
+ sceneInfo.outFolder = ['visual' resultSavePath '/' curSequence.seqName]; % tracking results saving path
10
+ createPath(['visual' resultSavePath '/']);
11
+ else
12
+ sceneInfo.outFolder = [];
13
+ end
14
+ sceneInfo.frameNums = stateInfo.frameNums;
15
+ sceneInfo.imgHeight = curSequence.imgHeight;
16
+ sceneInfo.imgWidth = curSequence.imgWidth;
17
+
18
+ %% Display parameters
19
+ sceneInfo.defaultColor = [.1 .2 .9];
20
+ sceneInfo.grey = 0.7*ones(1,3);
21
+ sceneInfo.framePause = 0.001; % pause between frames
22
+
23
+ sceneInfo.traceLength = 20; % overlay track from past n frames
24
+ sceneInfo.dotSize = 20;
25
+ sceneInfo.boxLineWidth = 3;
26
+ sceneInfo.traceWidth = 2;
27
+
28
+ % what to display
29
+ sceneInfo.displayDots = options.displayDots;
30
+ sceneInfo.displayBoxes = options.displayBoxes;
31
+ sceneInfo.displayID = options.displayID;
32
+ sceneInfo.displayCropouts = options.displayCropouts;
33
+ sceneInfo.displayConnections = options.displayConnections;
34
+
35
+ displayTrackingResult(sceneInfo, stateInfo, curSequence.seqName);
36
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/dropDetections.m ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function detections = dropDetections(detections, ignoreFile, imgHeight, imgWidth)
2
+
3
+ % drop detections in ignore region
4
+ ignoreRegion = load(ignoreFile);
5
+ if(~isempty(ignoreRegion))
6
+ igrMap = zeros(imgHeight, imgWidth);
7
+ numIgnore = size(ignoreRegion,1);
8
+ for j = 1:numIgnore
9
+ igrMap(ignoreRegion(j,2):min(imgHeight,ignoreRegion(j,2)+ignoreRegion(j,4)),ignoreRegion(j,1):min(imgWidth,ignoreRegion(j,1)+ignoreRegion(j,3))) = 1;
10
+ end
11
+ intIgrMap = createIntImg(double(igrMap));
12
+ idxIgnoreLeft = [];
13
+ for i = 1:size(detections, 1)
14
+ curDet = max(1,round(detections(i,3:6)));
15
+ x = max(1, min(imgWidth, curDet(1)));
16
+ y = max(1, min(imgHeight, curDet(2)));
17
+ w = curDet(3);
18
+ h = curDet(4);
19
+ tl = intIgrMap(y, x);
20
+ tr = intIgrMap(y, min(imgWidth,x+w));
21
+ bl = intIgrMap(max(1,min(imgHeight,y+h)), x);
22
+ br = intIgrMap(max(1,min(imgHeight,y+h)), min(imgWidth,x+w));
23
+ ignoreValue = tl + br - tr - bl;
24
+ if(ignoreValue/(h*w)<0.5)
25
+ idxIgnoreLeft = cat(1, idxIgnoreLeft, i);
26
+ end
27
+ end
28
+ detections = detections(idxIgnoreLeft, :);
29
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/dropTracks.m ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function stateInfo = dropTracks(stateInfo, curSequence)
2
+ %% Thank Victor Stamatescu <Victor.Stamatescu@unisa.edu.au> for his valuable comment to add this function
3
+
4
+ global options
5
+
6
+ % drop system tracks in ignored regions
7
+ ignoreRegion = curSequence.ignoreRegion;
8
+ imgHeight = curSequence.imgHeight;
9
+ imgWidth = curSequence.imgWidth;
10
+
11
+ dropBoxes = 0;
12
+ totalBoxes = 0;
13
+
14
+ if(~isempty(ignoreRegion))
15
+ igrMap = zeros(imgHeight, imgWidth);
16
+ numIgnore = size(ignoreRegion, 1);
17
+ for j = 1:numIgnore
18
+ igrMap(ignoreRegion(j,2):min(imgHeight,ignoreRegion(j,2)+ignoreRegion(j,4)),ignoreRegion(j,1):min(imgWidth,ignoreRegion(j,1)+ignoreRegion(j,3))) = 1;
19
+ end
20
+ intIgrMap = createIntImg(double(igrMap));
21
+ if(options.showRemoveResults)
22
+ figure(10); imagesc(igrMap); colormap bone; colorbar;
23
+ title('tracks: blue-drop red-keep, ignore region: white');
24
+ end
25
+ for i = 1:size(stateInfo.W,2)% tracks
26
+ for j = 1:size(stateInfo.W,1)% frames
27
+ h = round(stateInfo.H(j,i));
28
+ w = round(stateInfo.W(j,i));
29
+ if(w==0 || h==0)
30
+ continue;
31
+ end
32
+ totalBoxes = totalBoxes + 1;
33
+
34
+ xc = stateInfo.X(j,i);
35
+ yc = stateInfo.Y(j,i) - h/2;
36
+ x = round(xc - w/2);
37
+ y = round(yc - h/2);
38
+ if(options.showRemoveResults)
39
+ Left = x;
40
+ Top = y;
41
+ BoundingBox_X1 = Left;
42
+ BoundingBox_Y1 = Top + h;
43
+ BoundingBox_X2 = Left;
44
+ BoundingBox_Y2 = Top;
45
+ BoundingBox_X3 = Left + w;
46
+ BoundingBox_Y3 = Top;
47
+ BoundingBox_X4 = Left + w;
48
+ BoundingBox_Y4 = Top + h;
49
+ end
50
+ tl = intIgrMap(max(1,min(imgHeight,y)), max(1,min(imgWidth,x)));
51
+ tr = intIgrMap(max(1,min(imgHeight,y)), max(1,min(imgWidth,x+w)));
52
+ bl = intIgrMap(max(1,min(imgHeight,y+h)), max(1,min(imgWidth,x)));
53
+ br = intIgrMap(max(1,min(imgHeight,y+h)), max(1,min(imgWidth,x+w)));
54
+ ignoreValue = tl + br - tr - bl;
55
+ if(ignoreValue/(h*w)>=0.5)
56
+ dropBoxes = dropBoxes +1;
57
+ stateInfo.W(j,i) = 0;
58
+ stateInfo.H(j,i) = 0;
59
+ stateInfo.X(j,i) = 0;
60
+ stateInfo.Y(j,i) = 0;
61
+ stateInfo.Xi(j,i) = 0;
62
+ stateInfo.Yi(j,i) = 0;
63
+ if(options.showRemoveResults)
64
+ rect.vertices = [BoundingBox_X1 BoundingBox_Y1; BoundingBox_X2 BoundingBox_Y2;...
65
+ BoundingBox_X3 BoundingBox_Y3; BoundingBox_X4 BoundingBox_Y4; BoundingBox_X1 BoundingBox_Y1];
66
+ rect.faces = [1 2 3 4];
67
+ hold on; patch(rect,'Vertices',rect.vertices,'FaceColor',[0 0 1],'FaceAlpha',0.1); hold off; pause(0.1);
68
+ end
69
+ else
70
+ if(options.showRemoveResults)
71
+ rect.vertices = [BoundingBox_X1 BoundingBox_Y1; BoundingBox_X2 BoundingBox_Y2;...
72
+ BoundingBox_X3 BoundingBox_Y3; BoundingBox_X4 BoundingBox_Y4; BoundingBox_X1 BoundingBox_Y1];
73
+ rect.faces = [1 2 3 4];
74
+ hold on; patch(rect,'Vertices',rect.vertices,'FaceColor',[1 0 0],'FaceAlpha',0.1); hold off; pause(0.1);
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+
81
+ if(dropBoxes)
82
+ disp(['Ignored Regions ---> dropped ' num2str(dropBoxes) ' out of ' num2str(totalBoxes) ' boxes']);
83
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/evalexe.m ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ function evalexe(commandline)
2
+
3
+ if(verLessThan('matlab', '7.14.0'))
4
+ [status, b] = system(commandline);
5
+ else
6
+ [status,b] = system(commandline, '');
7
+ end
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/getMetricInfo.m ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function metricsInfo = getMetricInfo()
2
+
3
+ metricsInfo.names.long = {'Recall','Precision','False Alarm Rate', ...
4
+ 'GT Tracks','Mostly Tracked','Partially Tracked','Mostly Lost', ...
5
+ 'False Positives', 'False Negatives', 'ID Switches', 'Fragmentations', ...
6
+ 'MOTA','MOTP', 'MOTA Log'};
7
+
8
+ metricsInfo.names.short = {'Rcll','Prcn','FAR', ...
9
+ 'GT','MT','PT','ML', ...
10
+ 'FP', 'FN', 'IDs', 'FM', ...
11
+ 'MOTA','MOTP', 'MOTAL'};
12
+
13
+ metricsInfo.widths.long = [6 9 16 9 14 17 11 15 15 11 14 5 5 8];
14
+ metricsInfo.widths.short = [5 5 5 3 3 3 3 4 4 3 3 5 5 5];
15
+
16
+ metricsInfo.format.long = {'.1f','.1f','.2f', ...
17
+ 'i','.1f%%','.1f%%','.1f%%', ...
18
+ 'i','i','i','i', ...
19
+ '.1f','.1f','.1f'};
20
+
21
+ metricsInfo.format.short=metricsInfo.format.long;
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/getPRMetricInfo.m ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function metricsInfo = getPRMetricInfo()
2
+
3
+ metricsInfo.names.long = {'Recall','Precision','False Alarm Rate', ...
4
+ 'Mostly Tracked','Partially Tracked','Mostly Lost', ...
5
+ 'False Positives', 'False Negatives', 'ID Switches', 'Fragmentations', ...
6
+ 'MOTA','MOTP', 'MOTA Log'};
7
+
8
+ metricsInfo.names.short = {'PR-Rcll','PR-Prcn','PR-FAR', ...
9
+ 'PR-MT','PR-PT','PR-ML', ...
10
+ 'PR-FP', 'PR-FN', 'PR-IDs', 'PR-FM', ...
11
+ 'PR-MOTA','PR-MOTP', 'PR-MOTAL'};
12
+
13
+ metricsInfo.widths.long = [6 9 16 14 17 11 15 15 11 14 5 5 8];
14
+ metricsInfo.widths.short = [5 5 5 3 3 3 4 4 3 3 5 5 5];
15
+
16
+ metricsInfo.format.long = {'.1f','.1f','.2f', ...
17
+ '.1f%%','.1f%%','.1f%%', ...
18
+ '.1f','.1f','.1f','.1f', ...
19
+ '.1f','.1f','.1f'};
20
+
21
+ metricsInfo.format.short=metricsInfo.format.long;
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20011_IgR.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ 778.75,24.75,181.75,63.5
2
+ 930.75,94.75,29.75,33.5
3
+ 523.75,13.75,178.5,37.5
4
+ 207.75,34.75,270.5,94.5
5
+ 182.75,131.75,145.5,117.5
6
+ 0.5,231.75,88.75,121.5
7
+ 123.75,151.75,57.5,97.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20012_IgR.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 497.75,0.5,462.75,22.75
2
+ 820.75,28.75,139.75,50.5
3
+ 190.75,48.75,269.5,46.5
4
+ 356.75,0.5,78.5,45.75
5
+ 0.5,216.75,70.75,112.5
6
+ 106.75,98.75,191.5,120.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20032_IgR.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ 716.75,55.75,243.75,64.5
2
+ 877.75,123.75,82.75,55.5
3
+ 455.75,31.75,155.5,53.5
4
+ 120.75,62.75,227.5,101.5
5
+ 46.75,166.75,102.5,80.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20033_IgR.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ 458.75,0.5,159.5,53.75
2
+ 710.75,29.75,239.5,69.5
3
+ 824.75,101.75,129.5,55.5
4
+ 126.75,39.75,223.5,86.5
5
+ 38.75,126.75,186.5,111.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20034_IgR.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ 455.75,0.5,189.5,55.75
2
+ 718.75,32.75,241.75,60.5
3
+ 874.75,97.75,85.75,42.5
4
+ 133.75,37.75,219.5,94.5
5
+ 45.75,134.75,165.5,112.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20035_IgR.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ 450.75,0.5,183.5,60
2
+ 716.75,26.75,243.75,57.5
3
+ 877.75,87.75,82.75,51.5
4
+ 0.5,123.75,141.75,152.5
5
+ 144.75,85.75,97.5,114.5
6
+ 244.75,42.75,102.5,65.5
7
+ 0.5,279.75,27.75,25.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20051_IgR.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ 807.75,0.5,146.5,92.75
2
+ 543.75,0.5,173.5,58.75
3
+ 0.5,180.75,160.75,100.5
4
+ 122.75,116.75,266.5,74.5
5
+ 322.75,60.75,107.5,48.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20052_IgR.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 542.75,0.5,194.5,27.75
2
+ 832.75,0.5,127.75,53.75
3
+ 256.75,42.75,155.5,75.5
4
+ 135.75,88.75,120.5,132.5
5
+ 259.75,123.75,109.5,71.5
6
+ 0.5,166.75,131.75,107.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20061_IgR.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 513.75,13.75,185.5,46.5
2
+ 839.75,46.75,114.5,62.5
3
+ 298.75,59.75,112.5,121.5
4
+ 92.75,94.75,203.5,171.5
5
+ 0.5,246.75,90.75,282.5
6
+ 93.75,270.75,136.5,108.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20062_IgR.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 517.75,0.5,165,33.75
2
+ 824.75,30.75,135.75,54.5
3
+ 323.75,36.75,107.5,76.5
4
+ 97.75,107.75,336.5,56.5
5
+ 86.75,167.75,153.5,65.5
6
+ 0.5,234.75,155.75,103.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20063_IgR.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 851.75,14.75,108.75,48.5
2
+ 86.75,82.75,295.5,44.5
3
+ 316.75,20.75,111.5,60.5
4
+ 135.75,130.75,119.5,84.5
5
+ 85.75,183.75,47.5,69.5
6
+ 0.5,214.75,84.75,139.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20064_IgR.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ 511.75,0.5,269.5,27.75
2
+ 852.75,27.75,101.5,23.5
3
+ 895.75,54.75,64.75,20.5
4
+ 0.5,215.75,101.75,97.5
5
+ 106.75,89.75,56.5,156.5
6
+ 166.75,137.75,49.5,70.5
7
+ 218.75,90.75,35.5,88.5
8
+ 257.75,71.75,87.5,54.5
9
+ 347.75,21.75,77.5,68.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_20065_IgR.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 513.75,0.5,238.5,23.75
2
+ 857.75,15.75,102.75,46.5
3
+ 167.75,77.75,275.5,74.5
4
+ 329.75,10.75,104.5,64.5
5
+ 0.5,207.75,102.75,263.5
6
+ 104.75,155.75,155.5,147.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_39031_IgR.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 335.75,52.75,256.5,117.5
2
+ 0.5,296.75,223.75,120.5
3
+ 690.75,116.75,269.75,94.5
DETRAC/DETRAC-MOT-toolkit/DETRAC-MOT-toolkit/evaluation/igrs/MVI_39051_IgR.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 916.75,283.75,43.75,41.5
2
+ 853.75,443.75,99.5,91.5