diff --git a/yolox/tracker/byte_tracker.py b/yolox/tracker/byte_tracker.py index 2d004599..6aed9b71 100644 --- a/yolox/tracker/byte_tracker.py +++ b/yolox/tracker/byte_tracker.py @@ -7,7 +7,7 @@ import torch.nn.functional as F from .kalman_filter import KalmanFilter -from yolox.tracker import matching +from ByteTrack.yolox.tracker import matching from .basetrack import BaseTrack, TrackState class STrack(BaseTrack): @@ -15,7 +15,7 @@ class STrack(BaseTrack): def __init__(self, tlwh, score): # wait activate - self._tlwh = np.asarray(tlwh, dtype=np.float) + self._tlwh = np.asarray(tlwh, dtype=float) self.kalman_filter = None self.mean, self.covariance = None, None self.is_activated = False diff --git a/yolox/tracker/matching.py b/yolox/tracker/matching.py index d36a6cf5..8fdb5bc0 100644 --- a/yolox/tracker/matching.py +++ b/yolox/tracker/matching.py @@ -5,7 +5,7 @@ from scipy.spatial.distance import cdist from cython_bbox import bbox_overlaps as bbox_ious -from yolox.tracker import kalman_filter +from ByteTrack.yolox.tracker import kalman_filter import time def merge_matches(m1, m2, shape): @@ -58,13 +58,13 @@ def ious(atlbrs, btlbrs): :rtype ious np.ndarray """ - ious = np.zeros((len(atlbrs), len(btlbrs)), dtype=np.float) + ious = np.zeros((len(atlbrs), len(btlbrs)), dtype=float) if ious.size == 0: return ious ious = bbox_ious( - np.ascontiguousarray(atlbrs, dtype=np.float), - np.ascontiguousarray(btlbrs, dtype=np.float) + np.ascontiguousarray(atlbrs, dtype=float), + np.ascontiguousarray(btlbrs, dtype=float) ) return ious @@ -118,13 +118,13 @@ def embedding_distance(tracks, detections, metric='cosine'): :return: cost_matrix np.ndarray """ - cost_matrix = np.zeros((len(tracks), len(detections)), dtype=np.float) + cost_matrix = np.zeros((len(tracks), len(detections)), dtype=float) if cost_matrix.size == 0: return cost_matrix - det_features = np.asarray([track.curr_feat for track in detections], dtype=np.float) + det_features = np.asarray([track.curr_feat for track in detections], dtype=float) #for i, track in enumerate(tracks): #cost_matrix[i, :] = np.maximum(0.0, cdist(track.smooth_feat.reshape(1,-1), det_features, metric)) - track_features = np.asarray([track.smooth_feat for track in tracks], dtype=np.float) + track_features = np.asarray([track.smooth_feat for track in tracks], dtype=float) cost_matrix = np.maximum(0.0, cdist(track_features, det_features, metric)) # Nomalized features return cost_matrix @@ -178,4 +178,4 @@ def fuse_score(cost_matrix, detections): det_scores = np.expand_dims(det_scores, axis=0).repeat(cost_matrix.shape[0], axis=0) fuse_sim = iou_sim * det_scores fuse_cost = 1 - fuse_sim - return fuse_cost \ No newline at end of file + return fuse_cost