Skip to content

Commit 284f59a

Browse files
committed
Python 2 compability (thanks to Balint Fabry)
1 parent dfb238a commit 284f59a

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
## Introduction
44

55
This repository contains code for *Simple Online and Realtime Tracking with a Deep Association Metric* (Deep SORT).
6+
We extend the original [SORT](https://github.com/abewley/sort) algorithm to
7+
integrate appearance information based on a deep appearance descriptor.
68

79
## Dependencies
810

9-
Tracking code:
11+
The code is compatible with Python 2.7 and 3. The following dependencies are
12+
need to run the tracker:
1013

1114
* NumPy
12-
* sklean (for linear assignment)
13-
* OpenCV (for visualization)
15+
* sklean
16+
* OpenCV
1417

15-
Additionally, feature generation requires:
16-
17-
* TensorFlow
18-
* tfslim
18+
Additionally, feature generation requires TensorFlow (>= 1.0).
1919

2020
## Installation
2121

application_util/image_viewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def view_roi(mat, roi):
5858
return mat[sy:ey, sx:ex, :]
5959

6060

61-
class ImageViewer:
61+
class ImageViewer(object):
6262
"""An image viewer with drawing routines and video capture capabilities.
6363
6464
Key Bindings:

application_util/visualization.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ def create_unique_color_uchar(tag, hue_step=0.41):
5353
return int(255*r), int(255*g), int(255*b)
5454

5555

56-
class NoVisualization:
56+
class NoVisualization(object):
5757
"""
58-
TODO(nwojke): Add documentation.
58+
A dummy visualization object that loops through all frames in a given
59+
sequence to update the tracker without performing any visualization.
5960
"""
6061

6162
def __init__(self, seq_info):
@@ -80,9 +81,9 @@ def run(self, frame_callback):
8081
self.frame_idx += 1
8182

8283

83-
class Visualization:
84+
class Visualization(object):
8485
"""
85-
TODO(nwojke): Add documentation.
86+
This class shows tracking output in an OpenCV image viewer.
8687
"""
8788

8889
def __init__(self, seq_info, update_ms):
@@ -130,4 +131,4 @@ def draw_trackers(self, tracks):
130131
*track.to_tlwh().astype(np.int), label=str(track.track_id))
131132
# self.viewer.gaussian(track.mean[:2], track.covariance[:2, :2],
132133
# label="%d" % track.track_id)
133-
#
134+
#

deep_sort_app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def gather_sequence_info(sequence_dir, detection_file):
3131
A dictionary of the following sequence information:
3232
3333
* sequence_name: Name of the sequence
34-
* image_filanemes: A dictionary that maps frame indices to image filenames.
34+
* image_filenames: A dictionary that maps frame indices to image
35+
filenames.
3536
* detections: A numpy array of detections in MOTChallenge format.
3637
* groundtruth: A numpy array of ground truth in MOTChallenge format.
3738
* image_size: Image size (height, width).
@@ -163,7 +164,7 @@ def run(sequence_dir, detection_file, output_file, min_confidence,
163164
results = []
164165

165166
def frame_callback(vis, frame_idx):
166-
print("Frame idx", frame_idx)
167+
print("Processing frame %05d" % frame_idx)
167168

168169
# Load image and generate detections.
169170
detections = create_detections(

generate_videos.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ def parse_args():
5757
sys.exit()
5858
for sequence_txt in os.listdir(args.result_dir):
5959
sequence = os.path.splitext(sequence_txt)[0]
60-
if sequence != "KITTI-13":
61-
continue
6260
sequence_dir = os.path.join(args.mot_dir, sequence)
6361
if not os.path.exists(sequence_dir):
6462
continue

0 commit comments

Comments
 (0)