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
No related branches found
No related tags found
No related merge requests found
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
## Introduction ## Introduction
This repository contains code for *Simple Online and Realtime Tracking with a Deep Association Metric* (Deep SORT). 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 ## Dependencies
Tracking code: The code is compatible with Python 2.7 and 3. The following dependencies are
need to run the tracker:
* NumPy * NumPy
* sklean (for linear assignment) * sklean
* OpenCV (for visualization) * OpenCV
Additionally, feature generation requires: Additionally, feature generation requires TensorFlow (>= 1.0).
* TensorFlow
* tfslim
## Installation ## Installation
......
...@@ -58,7 +58,7 @@ def view_roi(mat, roi): ...@@ -58,7 +58,7 @@ def view_roi(mat, roi):
return mat[sy:ey, sx:ex, :] return mat[sy:ey, sx:ex, :]
class ImageViewer: class ImageViewer(object):
"""An image viewer with drawing routines and video capture capabilities. """An image viewer with drawing routines and video capture capabilities.
Key Bindings: Key Bindings:
......
...@@ -53,9 +53,10 @@ def create_unique_color_uchar(tag, hue_step=0.41): ...@@ -53,9 +53,10 @@ def create_unique_color_uchar(tag, hue_step=0.41):
return int(255*r), int(255*g), int(255*b) 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): def __init__(self, seq_info):
...@@ -80,9 +81,9 @@ class NoVisualization: ...@@ -80,9 +81,9 @@ class NoVisualization:
self.frame_idx += 1 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): def __init__(self, seq_info, update_ms):
......
...@@ -31,7 +31,8 @@ def gather_sequence_info(sequence_dir, detection_file): ...@@ -31,7 +31,8 @@ def gather_sequence_info(sequence_dir, detection_file):
A dictionary of the following sequence information: A dictionary of the following sequence information:
* sequence_name: Name of the sequence * 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. * detections: A numpy array of detections in MOTChallenge format.
* groundtruth: A numpy array of ground truth in MOTChallenge format. * groundtruth: A numpy array of ground truth in MOTChallenge format.
* image_size: Image size (height, width). * image_size: Image size (height, width).
...@@ -163,7 +164,7 @@ def run(sequence_dir, detection_file, output_file, min_confidence, ...@@ -163,7 +164,7 @@ def run(sequence_dir, detection_file, output_file, min_confidence,
results = [] results = []
def frame_callback(vis, frame_idx): def frame_callback(vis, frame_idx):
print("Frame idx", frame_idx) print("Processing frame %05d" % frame_idx)
# Load image and generate detections. # Load image and generate detections.
detections = create_detections( detections = create_detections(
......
...@@ -57,8 +57,6 @@ if __name__ == "__main__": ...@@ -57,8 +57,6 @@ if __name__ == "__main__":
sys.exit() sys.exit()
for sequence_txt in os.listdir(args.result_dir): for sequence_txt in os.listdir(args.result_dir):
sequence = os.path.splitext(sequence_txt)[0] sequence = os.path.splitext(sequence_txt)[0]
if sequence != "KITTI-13":
continue
sequence_dir = os.path.join(args.mot_dir, sequence) sequence_dir = os.path.join(args.mot_dir, sequence)
if not os.path.exists(sequence_dir): if not os.path.exists(sequence_dir):
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment