diff --git a/yolox/tracker/byte_tracker.py b/yolox/tracker/byte_tracker.py index 2d004599..626c3a90 100644 --- a/yolox/tracker/byte_tracker.py +++ b/yolox/tracker/byte_tracker.py @@ -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=np.float64) 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..2572c4d1 100644 --- a/yolox/tracker/matching.py +++ b/yolox/tracker/matching.py @@ -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=np.float64) 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=np.float64), + np.ascontiguousarray(btlbrs, dtype=np.float64) ) 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=np.float64) 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=np.float64) #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=np.float64) cost_matrix = np.maximum(0.0, cdist(track_features, det_features, metric)) # Nomalized features return cost_matrix