Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Necessary Changes to run on latest versions #308

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion deep_sort/linear_assignment.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim: expandtab:ts=4:sw=4
from __future__ import absolute_import
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from scipy.optimize import linear_sum_assignment as linear_assignment
from . import kalman_filter


Expand Down Expand Up @@ -56,6 +56,7 @@ def min_cost_matching(
tracks, detections, track_indices, detection_indices)
cost_matrix[cost_matrix > max_distance] = max_distance + 1e-5
indices = linear_assignment(cost_matrix)
indices = np.hstack([indices[0].reshape(((indices[0].shape[0]), 1)),indices[1].reshape(((indices[0].shape[0]), 1))])

matches, unmatched_tracks, unmatched_detections = [], [], []
for col, detection_idx in enumerate(detection_indices):
Expand Down
16 changes: 8 additions & 8 deletions tools/generate_detections.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ class ImageEncoder(object):

def __init__(self, checkpoint_filename, input_name="images",
output_name="features"):
self.session = tf.Session()
with tf.gfile.GFile(checkpoint_filename, "rb") as file_handle:
graph_def = tf.GraphDef()
self.session = tf.compat.v1.Session()
with tf.compat.v1.gfile.GFile(checkpoint_filename, "rb") as file_handle:
graph_def = tf.compat.v1.GraphDef()
graph_def.ParseFromString(file_handle.read())
tf.import_graph_def(graph_def, name="net")
self.input_var = tf.get_default_graph().get_tensor_by_name(
"net/%s:0" % input_name)
self.output_var = tf.get_default_graph().get_tensor_by_name(
"net/%s:0" % output_name)
tf.compat.v1.import_graph_def(graph_def, name="net")
self.input_var = tf.compat.v1.get_default_graph().get_tensor_by_name(
"%s:0" % input_name) #"net/%s:0" % input_name
self.output_var = tf.compat.v1.get_default_graph().get_tensor_by_name(
"%s:0" % output_name) #"net/%s:0" % output_name

assert len(self.output_var.get_shape()) == 2
assert len(self.input_var.get_shape()) == 4
Expand Down