Skip to content
Snippets Groups Projects
Commit 284f59a8 authored by Nicolai Wojke's avatar Nicolai Wojke
Browse files

Python 2 compability (thanks to Balint Fabry)

parent dfb238a9
Branches
No related tags found
No related merge requests found
......@@ -3,19 +3,19 @@
## Introduction
This repository contains code for *Simple Online and Realtime Tracking with a Deep Association Metric* (Deep SORT).
We extend the original [SORT](https://github.com/abewley/sort) algorithm to
integrate appearance information based on a deep appearance descriptor.
## Dependencies
Tracking code:
The code is compatible with Python 2.7 and 3. The following dependencies are
need to run the tracker:
* NumPy
* sklean (for linear assignment)
* OpenCV (for visualization)
* sklean
* OpenCV
Additionally, feature generation requires:
* TensorFlow
* tfslim
Additionally, feature generation requires TensorFlow (>= 1.0).
## Installation
......
......@@ -58,7 +58,7 @@ def view_roi(mat, roi):
return mat[sy:ey, sx:ex, :]
class ImageViewer:
class ImageViewer(object):
"""An image viewer with drawing routines and video capture capabilities.
Key Bindings:
......
......@@ -53,9 +53,10 @@ def create_unique_color_uchar(tag, hue_step=0.41):
return int(255*r), int(255*g), int(255*b)
class NoVisualization:
class NoVisualization(object):
"""
TODO(nwojke): Add documentation.
A dummy visualization object that loops through all frames in a given
sequence to update the tracker without performing any visualization.
"""
def __init__(self, seq_info):
......@@ -80,9 +81,9 @@ class NoVisualization:
self.frame_idx += 1
class Visualization:
class Visualization(object):
"""
TODO(nwojke): Add documentation.
This class shows tracking output in an OpenCV image viewer.
"""
def __init__(self, seq_info, update_ms):
......
......@@ -31,7 +31,8 @@ def gather_sequence_info(sequence_dir, detection_file):
A dictionary of the following sequence information:
* sequence_name: Name of the sequence
* image_filanemes: A dictionary that maps frame indices to image filenames.
* image_filenames: A dictionary that maps frame indices to image
filenames.
* detections: A numpy array of detections in MOTChallenge format.
* groundtruth: A numpy array of ground truth in MOTChallenge format.
* image_size: Image size (height, width).
......@@ -163,7 +164,7 @@ def run(sequence_dir, detection_file, output_file, min_confidence,
results = []
def frame_callback(vis, frame_idx):
print("Frame idx", frame_idx)
print("Processing frame %05d" % frame_idx)
# Load image and generate detections.
detections = create_detections(
......
......@@ -57,8 +57,6 @@ if __name__ == "__main__":
sys.exit()
for sequence_txt in os.listdir(args.result_dir):
sequence = os.path.splitext(sequence_txt)[0]
if sequence != "KITTI-13":
continue
sequence_dir = os.path.join(args.mot_dir, sequence)
if not os.path.exists(sequence_dir):
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment