Skip to content

Commit 276abac

Browse files
author
bochinski
committed
add everything at once
1 parent db8e786 commit 276abac

File tree

6 files changed

+443
-2
lines changed

6 files changed

+443
-2
lines changed

README.md

Lines changed: 144 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,145 @@
1-
# IOU-Tracker
1+
## IOU Tracker
2+
Python implementation of the IOU Tracker described in the AVSS 2017 paper
3+
[High-Speed Tracking-by-Detection Without Using Image Information](http://elvera.nue.tu-berlin.de/files/1517Bochinski2017.pdf).
24

3-
coming soon...
5+
This project is released under the MIT License (details in LICENSE file).
6+
If you think our work is useful in your research, please consider citing:
7+
8+
```
9+
@INPROCEEDINGS{1517Bochinski2017,
10+
AUTHOR = {Erik Bochinski and Volker Eiselein and Thomas Sikora},
11+
TITLE = {High-Speed Tracking-by-Detection Without Using Image Information},
12+
BOOKTITLE = {International Workshop on Traffic and Street Surveillance for Safety and Security at IEEE AVSS 2017},
13+
YEAR = {2017},
14+
MONTH = aug,
15+
ADDRESS = {Lecce, Italy},
16+
URL = {http://elvera.nue.tu-berlin.de/files/1517Bochinski2017.pdf},
17+
}
18+
```
19+
20+
## Demo
21+
Several demo scripts are included to reproduce the reported results on the UA-DETRAC
22+
and the MOT benchmark.
23+
24+
Basic demo script:
25+
```
26+
$ ./demo.py -h
27+
usage: demo.py [-h] -d DETECTION_PATH -o OUTPUT_PATH [-sl SIGMA_L]
28+
[-sh SIGMA_H] [-si SIGMA_IOU] [-tm T_MIN]
29+
30+
IOU Tracker demo script
31+
32+
optional arguments:
33+
-h, --help show this help message and exit
34+
-d DETECTION_PATH, --detection_path DETECTION_PATH
35+
full path to CSV file containing the detections
36+
-o OUTPUT_PATH, --output_path OUTPUT_PATH
37+
output path to store the tracking results (MOT
38+
challenge devkit compatible format)
39+
-sl SIGMA_L, --sigma_l SIGMA_L
40+
low detection threshold
41+
-sh SIGMA_H, --sigma_h SIGMA_H
42+
high detection threshold
43+
-si SIGMA_IOU, --sigma_iou SIGMA_IOU
44+
intersection-over-union threshold
45+
-tm T_MIN, --t_min T_MIN
46+
minimum track length
47+
```
48+
49+
Example:
50+
```
51+
./demo.py -d ../mot17/train/MOT17-04-SDP/det/det.txt -o res/iou-tracker/MOT17-04-SDP.txt
52+
```
53+
54+
### DETRAC
55+
To reproduce the reported results, download and extract the [DETRAC-toolkit](http://detrac-db.rit.albany.edu/download)
56+
and the detections you want to evaluate. Download links for the EB detections are provided below.
57+
Clone this repository into "DETRAC-MOT-toolkit/trackers/".
58+
Follow the instructions to configure the toolkit for tracking evaluation and set the tracker name in "DETRAC_experiment.m":
59+
60+
```
61+
tracker.trackerName = 'iou-tracker';
62+
```
63+
64+
and run the script.
65+
66+
Note that you still need a working python environment.
67+
You should obtain something like the following results for the 'DETRAC-Train' set:
68+
69+
##### DETRAC-Train Results
70+
| Detector | Rcll | Prcn | FAR | MT | PT | ML | FP | FN | IDs | FM | MOTA | MOTP | MOTAL |
71+
| -------- | ---- | ---- | --- | ----- | --- | ------ | ------- | ------- | ----- | ----- |----- |------|-------|
72+
| EB |22.12 |31.53 |0.26 |17.65 |13.22|18.41 |14796.52 |171806.84|2311.25|2445.89|19.41 |28.89 |19.78 |
73+
| R-CNN |27.86 |52.90 |0.11 |19.53 |17.03|18.56 |9047.95 |157521.18|4842.18|4969.57|25.46 |44.39 |26.29 |
74+
75+
##### DETRAC-Test (Overall) Results
76+
| Detector | Rcll | Prcn | FAR | MT | PT | ML | FP | FN | IDs | FM | MOTA | MOTP | MOTAL |
77+
| -------- | ---- | ---- | --- | ----- | --- | ------ | ------- | ------- | ----- | ----- |----- |------|-------|
78+
| EB |22.11 |31.53 |0.26 |17.65 |13.22|18.41 |14796.52 |171806.84|2311.25|2445.89|19.41 |28.89 |19.77 |
79+
| R-CNN |20.37 |44.86 |0.40 |13.81 |16.40|20.69 |22535.15 |193041.87|5029.42|5795.73|16.01 |38.35 |16.81 |
80+
81+
##### EB detections
82+
The public detections of [EB](http://zyb.im/research/EB/) are not available on the
83+
DETRAC training set and miss some low scoring detections. The EB detections we used for the tables above and our
84+
publication are available here:
85+
86+
* [EB Train](https://tubcloud.tu-berlin.de/s/EtC6cFEYsAU0gFQ/download)
87+
* [EB Test](https://tubcloud.tu-berlin.de/s/oKM3dYhJbMFl1dY/download)
88+
89+
### MOT
90+
To reproduce the reported MOT16 results, use the mot16.py script:
91+
92+
```
93+
$ ./mot16.py -h
94+
usage: mot16.py [-h] -m SEQMAP -o RES_DIR -b BENCHMARK_DIR [-sl SIGMA_L]
95+
[-sh SIGMA_H] [-si SIGMA_IOU] [-tm T_MIN]
96+
97+
IOU Tracker MOT demo script. Default parameters are set to reproduce the
98+
results using the SDP detections.
99+
100+
optional arguments:
101+
-h, --help show this help message and exit
102+
-m SEQMAP, --seqmap SEQMAP
103+
full path to the seqmap file to evaluate
104+
-o RES_DIR, --res_dir RES_DIR
105+
path to the results directory
106+
-b BENCHMARK_DIR, --benchmark_dir BENCHMARK_DIR
107+
path to the sequence directory
108+
-sl SIGMA_L, --sigma_l SIGMA_L
109+
low detection threshold
110+
-sh SIGMA_H, --sigma_h SIGMA_H
111+
high detection threshold
112+
-si SIGMA_IOU, --sigma_iou SIGMA_IOU
113+
intersection-over-union threshold
114+
-tm T_MIN, --t_min T_MIN
115+
minimum track length
116+
```
117+
118+
Example:
119+
```
120+
# SDP:
121+
./mot16.py -m ../motchallenge/seqmaps/sdp-train.txt -o ../motchallenge/res/MOT16/iou-tracker -b ../data/mot17/train
122+
123+
# FRCNN:
124+
./mot16.py -m ../motchallenge/seqmaps/frcnn-train.txt -o ../motchallenge/res/MOT16/iou-tracker -b ../data/mot17/train -sl 0 -sh 0.9 -si 0.3 -tm 5
125+
```
126+
127+
You should obtain something like the following results for the train set:
128+
129+
##### MOT16 Train Results
130+
| Detector | IDF1 | IDP | IDR | Rcll | Prcn | FAR | GT | MT | PT | ML | FP | FN | IDs | FM | MOTA | MOTP | MOTAL |
131+
| -------- | ---- | --- | --- | ---- | ---- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---- | ---- | ----- |
132+
|SDP |24.7 |46.2 |16.9 |65.0 |97.6 |0.34 |546 |178 |232 |136 |1796 |39348|1198 |1453 |62.3 |83.4 |63.4 |
133+
|FRCNN |21.0 |46.5 |13.6 |51.8 |97.2 |0.31 |546 |109 |261 |176 |1674 |54082|716 |810 |49.7 |88.2 |50.3 |
134+
135+
##### MOT16 Test Results
136+
| Detector | Rcll | Prcn | FAR | GT | MT | PT | ML | FP | FN | IDs | FM | MOTA | MOTP |
137+
| -------- | ---- | ---- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---- | ---- |
138+
|SDP |61.5 |95.2 |0.96 |759 |179 |330 |250 |5702 |70278|2167 |3028 |57.1 |77.1 |
139+
|FRCNN |50.9 |92.4 |1.29 |759 |113 |381 |265 |7639 |89535| 2284|2310 |45.4 |77.5 |
140+
141+
Please note that this evaluation already includes the new ground truth of the MOT17 release.
142+
143+
## Contact
144+
If you have any questions or encounter problems regarding the method/code feel free to contact me
145+

demo.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env python
2+
3+
# ---------------------------------------------------------
4+
# IOU Tracker
5+
# Copyright (c) 2017 TU Berlin, Communication Systems Group
6+
# Licensed under The MIT License [see LICENSE for details]
7+
# Written by Erik Bochinski
8+
# ---------------------------------------------------------
9+
10+
from time import time
11+
import argparse
12+
13+
from iou_tracker import track_iou
14+
from util import load_mot, save_to_csv
15+
16+
17+
def main(args):
18+
detections = load_mot(args.detection_path)
19+
20+
start = time()
21+
tracks = track_iou(detections, args.sigma_l, args.sigma_h, args.sigma_iou, args.t_min)
22+
end = time()
23+
24+
num_frames = len(detections)
25+
print("finished at " + str(int(num_frames / (end - start))) + " fps!")
26+
27+
save_to_csv(args.output_path, tracks)
28+
29+
30+
if __name__ == '__main__':
31+
32+
parser = argparse.ArgumentParser(description="IOU Tracker demo script")
33+
parser.add_argument('-d', '--detection_path', type=str, required=True,
34+
help="full path to CSV file containing the detections")
35+
parser.add_argument('-o', '--output_path', type=str, required=True,
36+
help="output path to store the tracking results (MOT challenge devkit compatible format)")
37+
parser.add_argument('-sl', '--sigma_l', type=float, default=0,
38+
help="low detection threshold")
39+
parser.add_argument('-sh', '--sigma_h', type=float, default=0.5,
40+
help="high detection threshold")
41+
parser.add_argument('-si', '--sigma_iou', type=float, default=0.5,
42+
help="intersection-over-union threshold")
43+
parser.add_argument('-tm', '--t_min', type=float, default=2,
44+
help="minimum track length")
45+
46+
args = parser.parse_args()
47+
main(args)

mot16.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env python
2+
3+
# ---------------------------------------------------------
4+
# IOU Tracker
5+
# Copyright (c) 2017 TU Berlin, Communication Systems Group
6+
# Licensed under The MIT License [see LICENSE for details]
7+
# Written by Erik Bochinski
8+
# ---------------------------------------------------------
9+
10+
from time import time
11+
import argparse
12+
13+
from iou_tracker import track_iou
14+
from util import load_mot, save_to_csv
15+
16+
17+
def main(args):
18+
with open(args.seqmap) as fd:
19+
seqs = [line.rstrip('\n') for line in fd]
20+
21+
for idx, seq in enumerate(seqs):
22+
if seq == "name" or seq == "":
23+
continue
24+
else:
25+
det_path = args.benchmark_dir + "/" + seq + "/det/det.txt"
26+
out_path = args.res_dir + "/" + seq + ".txt"
27+
28+
detections = load_mot(det_path)
29+
30+
start = time()
31+
tracks = track_iou(detections, args.sigma_l, args.sigma_h, args.sigma_iou, args.t_min)
32+
end = time()
33+
34+
num_frames = len(detections)
35+
print("finished " + seq + " at " + str(int(num_frames / (end - start))) + " fps!")
36+
37+
save_to_csv(out_path, tracks)
38+
39+
40+
if __name__ == '__main__':
41+
42+
parser = argparse.ArgumentParser(description="IOU Tracker MOT demo script. Default parameters are set to reproduce "
43+
"the results using the SDP detections.")
44+
parser.add_argument('-m', '--seqmap', type=str, required=True,
45+
help="full path to the seqmap file to evaluate")
46+
parser.add_argument('-o', '--res_dir', type=str, required=True,
47+
help="path to the results directory")
48+
parser.add_argument('-b', '--benchmark_dir', type=str, required=True,
49+
help="path to the sequence directory")
50+
parser.add_argument('-sl', '--sigma_l', type=float, default=0.3,
51+
help="low detection threshold")
52+
parser.add_argument('-sh', '--sigma_h', type=float, default=0.5,
53+
help="high detection threshold")
54+
parser.add_argument('-si', '--sigma_iou', type=float, default=0.3,
55+
help="intersection-over-union threshold")
56+
parser.add_argument('-tm', '--t_min', type=float, default=5,
57+
help="minimum track length")
58+
59+
args = parser.parse_args()
60+
main(args)

run_tracker.m

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
function [stateInfo, speed] = run_tracker(curSequence, baselinedetections)
2+
%% tracker configuration
3+
%% R-CNN
4+
sigma_l = 0;
5+
sigma_h = 0.7;
6+
sigma_iou = 0.5;
7+
t_min = 2;
8+
9+
% %% ACF
10+
% sigma_l = 0;
11+
% sigma_h = 0.3;
12+
% sigma_iou = 0.5;
13+
% t_min = 3;
14+
15+
% %% CompACT
16+
% sigma_l = 0;
17+
% sigma_h = 0.2;
18+
% sigma_iou = 0.5;
19+
% t_min = 2;
20+
21+
% %% EB
22+
% sigma_l = 0;
23+
% sigma_h = 0.8;
24+
% sigma_iou = 0.5;
25+
% t_min = 2;
26+
27+
%% running tracking algorithm
28+
try
29+
ret = py.iou_tracker.track_iou_matlab_wrapper(py.numpy.array(baselinedetections(:).'), sigma_l, sigma_h, sigma_iou, t_min);
30+
31+
catch exception
32+
disp("error while calling the python tracking module: ")
33+
disp(" ")
34+
disp(getReport(exception))
35+
end
36+
speed = ret{1};
37+
track_result = cell2mat(reshape(ret{2}.cell.', 6, []).');
38+
39+
%% convert and save the mot style track_result
40+
stateInfo = saveStateInfo(track_result, numel(curSequence.frameNums));

saveStateInfo.m

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
function stateInfo = saveStateInfo(track_result, frame_num)
2+
3+
try
4+
sorted_result = sortrows(track_result,6);
5+
detect_num = size(sorted_result,1);
6+
catch
7+
detect_num = 0;
8+
9+
stateInfo.X(:,1) = zeros(frame_num,1);
10+
stateInfo.Y(:,1) = zeros(frame_num,1);
11+
stateInfo.Xi(:,1) = zeros(frame_num,1);
12+
stateInfo.Yi(:,1) = zeros(frame_num,1);
13+
stateInfo.W(:,1) = zeros(frame_num,1);
14+
stateInfo.H(:,1) = zeros(frame_num,1);
15+
end
16+
17+
stateInfo.F = frame_num;
18+
stateInfo.frameNums = 1:frame_num;
19+
index = 0;
20+
cur_id = -1;
21+
22+
for i = 1:detect_num
23+
if (cur_id ~= sorted_result(i,6))
24+
cur_id = sorted_result(i,6);
25+
index = index + 1;
26+
stateInfo.X(:,index) = zeros(frame_num,1);
27+
stateInfo.Y(:,index) = zeros(frame_num,1);
28+
stateInfo.Xi(:,index) = zeros(frame_num,1);
29+
stateInfo.Yi(:,index) = zeros(frame_num,1);
30+
stateInfo.W(:,index) = zeros(frame_num,1);
31+
stateInfo.H(:,index) = zeros(frame_num,1);
32+
end
33+
bbox = sorted_result(i,:);
34+
n = bbox(1,5);
35+
stateInfo.X(n,index) = bbox(1,1)+0.5*bbox(1,3);
36+
stateInfo.Y(n,index) = bbox(1,2)+bbox(1,4);
37+
stateInfo.Xi(n,index) = stateInfo.X(n,index);
38+
stateInfo.Yi(n,index) = stateInfo.Y(n,index);
39+
stateInfo.W(n,index) = bbox(1,3);
40+
stateInfo.H(n,index) = bbox(1,4);
41+
end

0 commit comments

Comments
 (0)