Skip to content

Commit

Permalink
Python 2 compability (thanks to Balint Fabry)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwojke committed Mar 21, 2017
1 parent dfb238a commit 284f59a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion application_util/image_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 6 additions & 5 deletions application_util/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -80,9 +81,9 @@ def run(self, frame_callback):
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):
Expand Down Expand Up @@ -130,4 +131,4 @@ def draw_trackers(self, tracks):
*track.to_tlwh().astype(np.int), label=str(track.track_id))
# self.viewer.gaussian(track.mean[:2], track.covariance[:2, :2],
# label="%d" % track.track_id)
#
#
5 changes: 3 additions & 2 deletions deep_sort_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions generate_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def parse_args():
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
Expand Down

0 comments on commit 284f59a

Please sign in to comment.