Home

Awesome

IOU Tracker

Python implementation of the IOU/V-IOU Tracker described in the AVSS 2017/2018 papers:

High-Speed Tracking-by-Detection Without Using Image Information

Extending IOU Based Multi-Object Tracking by Visual Information

This project is released under the MIT License (details in LICENSE file). If you think our work is useful in your research, please consider citing:

@INPROCEEDINGS{1517Bochinski2017,
	AUTHOR = {Erik Bochinski and Volker Eiselein and Thomas Sikora},
	TITLE = {High-Speed Tracking-by-Detection Without Using Image Information},
	BOOKTITLE = {International Workshop on Traffic and Street Surveillance for Safety and Security at IEEE AVSS 2017},
	YEAR = {2017},
	MONTH = aug,
	ADDRESS = {Lecce, Italy},
	URL = {http://elvera.nue.tu-berlin.de/files/1517Bochinski2017.pdf},
	}

@INPROCEEDINGS{1547Bochinski2018,
	AUTHOR = {Erik Bochinski and Tobias Senst and Thomas Sikora},
	TITLE = {Extending IOU Based Multi-Object Tracking by Visual Information},
	BOOKTITLE = {IEEE International Conference on Advanced Video and Signals-based Surveillance},
	YEAR = {2018},
	MONTH = nov,
	PAGES = {441--446},
	ADDRESS = {Auckland, New Zealand},
	URL = {http://elvera.nue.tu-berlin.de/files/1547Bochinski2018.pdf}
}

Table Of Contents

Update (Jan 2020):

Update (December 2018):

Install

The repository now contains the code for both the IOU tracker and the V-IOU tracker. The IOU Tracker only depends on numpy while V-IOU also requires OpenCV-Contrib and some other dependencies. It is recommended to use a virtual environment to run the code:

virtualenv -p python3 env
source env/bin/activate
pip install numpy lapsolver tqdm opencv-contrib-python

This should get you started with a basic installation to run most the scripts in this repository.

KCF/KCF2

Two different implementations of the KCF visual tracker can be used. One is supplied by OpenCV-Contrib and is denoted as KCF. This one should work out of the box. The second implementation is denoted as KCF2. This one is needed to reproduce the reported results. In order to use this you need to install KCFcpp-py-wrapper, which is a Cython based wrapper of the original KCF code for python. It is recommended to build and install OpenCV from scratch instead of using the PyPI package in order to have all the necessary headers and libraries available.

Why? Because this implementation seems to work better and much faster than the one provided by OpenCV-Contrib.

If you do not install this module the tracker will automatically fall back on the OpenCV implementation (i.e. KCF) and a warning is printed. You can get rid of this warning by either by installing the other KCF module as described above or explicitly request KCF instead of KCF2 in the scripts. Note that the tracking performance will be affected by this.

Demo

Several demo scripts are included to reproduce the reported results on the UA-DETRAC , MOT 16/17/19 and VisDrone benchmarks.

Basic demo script (not dataset specific, can be used for other applications):

$ ./demo.py -h
usage: demo.py [-h] [-v VISUAL] [-hr KEEP_UPPER_HEIGHT_RATIO] [-f FRAMES_PATH]
               -d DETECTION_PATH -o OUTPUT_PATH [-sl SIGMA_L] [-sh SIGMA_H]
               [-si SIGMA_IOU] [-tm T_MIN] [-ttl TTL] [-nms NMS] [-fmt FORMAT]

IOU/V-IOU Tracker demo script

optional arguments:
  -h, --help            show this help message and exit
  -v VISUAL, --visual VISUAL
                        visual tracker for V-IOU. Currently supported are
                        [BOOSTING, MIL, KCF, KCF2, TLD, MEDIANFLOW, GOTURN,
                        NONE] see README.md for furthert details
  -hr KEEP_UPPER_HEIGHT_RATIO, --keep_upper_height_ratio KEEP_UPPER_HEIGHT_RATIO
                        Ratio of height of the object to track to the total
                        height of the object for visual tracking. e.g. upper
                        30%
  -f FRAMES_PATH, --frames_path FRAMES_PATH
                        sequence frames with format
                        '/path/to/frames/frame_{:04d}.jpg' where '{:04d}' will
                        be replaced with the frame id. (zero_padded to 4
                        digits, use {:05d} for 5 etc.)
  -d DETECTION_PATH, --detection_path DETECTION_PATH
                        full path to CSV file containing the detections
  -o OUTPUT_PATH, --output_path OUTPUT_PATH
                        output path to store the tracking results (MOT
                        challenge/Visdrone devkit compatible format)
  -sl SIGMA_L, --sigma_l SIGMA_L
                        low detection threshold
  -sh SIGMA_H, --sigma_h SIGMA_H
                        high detection threshold
  -si SIGMA_IOU, --sigma_iou SIGMA_IOU
                        intersection-over-union threshold
  -tm T_MIN, --t_min T_MIN
                        minimum track length
  -ttl TTL, --ttl TTL   time to live parameter for v-iou
  -nms NMS, --nms NMS   nms for loading multi-class detections
  -fmt FORMAT, --format FORMAT
                        format of the detections [motchallenge, visdrone]

Example for the IOU tracker on the MOT17-04 sequence (detections can be downloaded here):

./demo.py -d ../mot17/train/MOT17-04-SDP/det/det.txt -o res/iou-tracker/MOT17-04-SDP.txt

Example for the V-IOU tracker on the uav0000137_00458_v Visdrone sequence:

demo.py -f '/path/to/VisDrone2018-MOT-val/sequences/uav0000137_00458_v/{:07d}.jpg' -d /path/to/VisDrone2018-MOT-val/detections/uav0000137_00458_v.txt -o results/VisDrone2018-MOT-val/uav0000137_00458_v.txt -v MEDIANFLOW -sl 0.9 -sh 0.98 -si 0.1 -tm 23 --ttl 8 --nms 0.6 -fmt visdrone

DETRAC

To reproduce the reported results, download and extract the DETRAC-toolkit and the detections you want to evaluate. Download links for the EB and Mask R-CNN detections are provided below. Clone this repository into "DETRAC-MOT-toolkit/trackers/". Follow the instructions to configure the toolkit for tracking evaluation and set the tracker name in "DETRAC_experiment.m":

tracker.trackerName = 'iou-tracker';

and run the script. You can switch between IOU and V-IOU and select the different parameters for different detectors in run_tracker.m

Note that you still need a working python environment with numpy for IOU and all other dependencies for V-IOU installed. You should obtain something like the following results for the 'DETRAC-Train' set:

DETRAC-Train Results

IOU Tracker:

DetectorPR-RcllPR-PrcnPR-FARPR-MTPR-PTPR-MLPR-FPPR-FNPR-IDsPR-FMPR-MOTAPR-MOTPPR-MOTAL
EB37.8644.730.1032.3412.8820.937958.82163739.854129.404221.8935.7740.8136.48
R-CNN27.8652.900.1119.5317.0318.569047.95157521.184842.184969.5725.4644.3926.29
CompACT25.2049.690.1018.5014.1119.068053.54153026.992021.842302.8323.4642.9623.81
ACF27.3952.680.1420.2415.6619.4011553.49161293.271845.492101.4425.0744.7125.39
Mask R-CNN43.2147.260.6037.2211.4624.2450096.88171714.091021.94929.5334.3645.4334.54

V-IOU Tracker:

DetectorPR-RcllPR-PrcnPR-FARPR-MTPR-PTPR-MLPR-FPPR-FNPR-IDsPR-FMPR-MOTAPR-MOTPPR-MOTAL
CompACT26.8449.570.1019.6314.6717.398750.71143532.90244.98444.2025.2941.5825.33
Mask R-CNN42.8047.500.6038.328.3626.2450294.76174052.00448.16293.6934.0246.8734.10
DETRAC-Test (Overall) Results

The reference results are taken from the UA-DETRAC results site. Only the best tracker / detector combination is displayed for each reference method.

TrackerDetectorPR-MOTAPR-MOTPPR-MTPR-MLPR-IDsPR-FMPR-FPPR-FNSpeed
CEMCompACT5.1%35.2%3.0%35.3%267.9352.312341.2260390.44.62 fps
CMOTCompACT12.6%36.1%16.1%18.6%285.31516.857885.9167110.83.79 fps
GOGCompACT14.2%37.0%13.9%19.9%3334.63172.432092.9180183.8390 fps
DCTR-CNN11.7%38.0%10.1%22.8%758.7742.9336561.2210855.60.71 fps
H<sup>2</sup>TCompACT12.4%35.7%14.8%19.4%852.21117.251765.7173899.83.02 fps
IHTLSCompACT11.1%36.8%13.8%19.9%953.63556.953922.3180422.319.79 fps
IOUR-CNN16.0%38.3%13.8%20.7%5029.45795.722535.1193041.9100,840 fps
IOUEB19.4%28.9%17.7%18.4%2311.32445.914796.5171806.86,902 fps
IOUCompACT16.1%37.0%14.8%19.7%2308.13250.424349.4176752.8327,660 fps
IOUMask R-CNN30.7%37.0%30.3%21.5%668.0733.617370.3179505.914,956 fps
V-IOUCompACT17.7%36.4%17.4%18.8%363.81123.526413.3166571.71117.90fps
V-IOUMask R-CNN30.7%37.0%32.0%22.6%162.6286.218046.2179191.2359.18 fps
EB detections

The public detections of EB are not available on the DETRAC training set and miss some low scoring detections. The EB detections we used for the tables above and our publication are available here:

Mask R-CNN detections

These detections are generated using a recent Mask R-CNN implementation trained on COCO. Only bounding boxes for COCOs car, bus and truck classes are included. Note that the detector is called "frcnn" (use options.detectorSet = {'frcnn'}; in initialize_environment.m).

Motchallenge

MOT16

To reproduce the reported MOT16 results of the paper, use the mot16.py script:

$ ./mot16.py -h
usage: mot16.py [-h] -m SEQMAP -o RES_DIR -b BENCHMARK_DIR [-sl SIGMA_L]
                [-sh SIGMA_H] [-si SIGMA_IOU] [-tm T_MIN]

IOU Tracker MOT demo script. Default parameters are set to reproduce the
results using the SDP detections.

optional arguments:
  -h, --help            show this help message and exit
  -m SEQMAP, --seqmap SEQMAP
                        full path to the seqmap file to evaluate
  -o RES_DIR, --res_dir RES_DIR
                        path to the results directory
  -b BENCHMARK_DIR, --benchmark_dir BENCHMARK_DIR
                        path to the sequence directory
  -sl SIGMA_L, --sigma_l SIGMA_L
                        low detection threshold
  -sh SIGMA_H, --sigma_h SIGMA_H
                        high detection threshold
  -si SIGMA_IOU, --sigma_iou SIGMA_IOU
                        intersection-over-union threshold
  -tm T_MIN, --t_min T_MIN
                        minimum track length

Examples (you will probably need to adapt the paths):

# SDP:
./mot16.py -m ../motchallenge/seqmaps/sdp-train.txt -o ../motchallenge/res/MOT16/iou-tracker -b ../data/mot17/train

# FRCNN:
./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

The seqmap files can be found under "seqmaps" and need to be copied to the respective directory of the motchallenge devkit. You should obtain something like the following results for the train set:

MOT16 Train Results
DetectorIDF1IDPIDRRcllPrcnFARGTMTPTMLFPFNIDsFMMOTAMOTPMOTAL
SDP24.746.216.965.097.60.345461782321361796393481198145362.383.463.4
FRCNN21.046.513.651.897.20.3154610926117616745408271681049.788.250.3
MOT16 Test Results
DetectorRcllPrcnFARGTMTPTMLFPFNIDsFMMOTAMOTP
SDP61.595.20.967591793302505702702782167302857.177.1
FRCNN50.992.41.297591133812657639895352284231045.477.5

Please note that this evaluation already includes the new ground truth of the MOT17 release.

MOT17

The IOU Tracker was evaluated on the MOT17 benchmark as well. To determine the best parameters for each detector, an exhaustive search of the parameter space was performed similar to the one of the MOT16 evaluation reported in the paper. The best configuration for the training sequences is:

Detectorsigma_lsigma_hsigma_iout_min
DPM-0.50.50.44
FRCNN0.00.90.33
SPD0.40.50.22

To generate the MOT17 results listed at MOT17 results, use the mot17.py script. Note that the parameters from above are hard-coded in the script for your convenience.

usage: mot17.py [-h] -m SEQMAP -o RES_DIR -b BENCHMARK_DIR

IOU Tracker MOT17 demo script. The best parameters for each detector are
hardcoded.

optional arguments:
  -h, --help            show this help message and exit
  -m SEQMAP, --seqmap SEQMAP
                        full path to the seqmap file to evaluate
  -o RES_DIR, --res_dir RES_DIR
                        path to the results directory
  -b BENCHMARK_DIR, --benchmark_dir BENCHMARK_DIR
                        path to the sequence directory

Examples (you will probably need to adapt the paths):

./mot17.py -m ../motchallenge/seqmaps/c10-train.txt -o ../motchallenge/res/MOT17/iou-tracker -b ../data/mot17/train
./mot17.py -m ../motchallenge/seqmaps/c10-test.txt -o ../motchallenge/res/MOT17/iou-tracker -b ../data/mot17/test
MOT17 Train Results
DetectorIDF1IDPIDRRcllPrcnFARGTMTPTMLFPFNIDsFMMOTAMOTPMOTAL
DPM14.339.38.735.888.11.025464519530654207214071984430.377.130.9
FRCNN21.647.514.052.197.00.3454611126816718045377485787649.788.150.5
SDP24.444.516.866.896.80.475461972401092509372802058206562.783.264.6
All9.921.56.451.694.70.61163835370358297331631943634378547.683.448.7
MOT17 Test Results
MOTAMOTPFAFMTMLFPFNID Sw.Frag
45.576.91.115.7%40.5%19,993281,6435,9887,404

CVPR19

To reproduce the results on the CVPR19 dataset you can use the cvpr19.sh bash script.

Edit the first lines according to your setup:

# set these variables according to your setup
seq_dir=/path/to/cvpr19/train # base directory of the split (cvpr19/train, cvpr19/test etc.)
results_dir=results/cvpr19    # output directory, will be created if not existing

Then, run (The used parameters for the demo.py script will be displayed for your convenience):

./cvpr19.sh

Note that this requires to have KCF2 tracker installed.

Note that only the upper 30% of the detections are used for visual tracking since the bottom part is often occluded. Due to time constraints only KCF2 was evaluated for the CVPR19 challenge participation, MEDIANFLOW might yield better results like for the Visdrone-MOT experiments but additional parameter tuning is required.

CVPR19 Train Results
DetectorIDF1IDPIDRRcllPrcnFARGTMTPTMLFPFNIDsFMMOTAMOTPMOTAL
FRCNN53.971.643.259.999.30.632274670118741755844971703272479259.287.559.5

Visdrone-MOT

To reproduce the results on the Visdrone MOT dataset you can use the visdrone-mot.sh bash script. Edit the first lines according to your setup:

# set these variables according to your setup
visdrone_dir=/path/to/VisDrone2018-MOT-val  # base directory of the split (VisDrone2018-MOT-val, VisDrone2018-MOT-train etc.)
results_dir=results/VisDrone2018-MOT-val    # output directory, will be created if not existing
vis_tracker=MEDIANFLOW                      # [MEDIANFLOW, KCF2, NONE] parameter set as used in the paper

Then, run (The used parameters for the demo.py script will be displayed for your convenience):

./visdrone-mot.sh
Visdrone-MOT Val Results

For the VisDrone2018-MOT-val split you should get the following results:

Visual TrackerIDF1IDPIDRRcllPrcnFARGTMTPTMLFPFNIDsFMMOTAMOTPMOTAL
None40.968.529.234.681.30.604761027629757364697917743526.478.126.6
KCF45.375.332.435.281.80.59476105643055605465787638527.377.927.4
Medianflow45.675.932.635.382.20.58476107633045494464666537827.677.827.7

Contact

If you have any questions or encounter problems regarding the method/code feel free to contact me at bochinski@nue.tu-berlin.de