lint fixed

This commit is contained in:
dbroboflow committed 2023-08-01 13:10:36 +00:00
1 parent aa50052ff5
commit 8eaa42abc6
2 files changed
+8 -4

No files matched your search

@@ -397,7 +397,7 @@ class ByteTrack:
# Predict the current location with KF
Strack.multi_predict(strack_pool)
dists = matching.iou_distance(strack_pool, detections)
dists = matching.fuse_score(dists, detections)
matches, u_track, u_detection = matching.linear_assignment(
dists, thresh=self.match_thresh
@@ -451,7 +451,7 @@ class ByteTrack:
"""Deal with unconfirmed tracks, usually tracks with only one beginning frame"""
detections = [detections[i] for i in u_detection]
dists = matching.iou_distance(unconfirmed, detections)
dists = matching.fuse_score(dists, detections)
matches, u_unconfirmed, u_detection = matching.linear_assignment(
dists, thresh=0.7
+6 -2
View File
@@ -1,7 +1,7 @@
import numpy as np
import scipy
from scipy.spatial.distance import cdist
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import cdist
from supervision.tracker.byte_tracker import kalman_filter
@@ -42,7 +42,11 @@ def linear_assignment(cost_matrix, thresh):
:return: matches, unmatched_a, unmatched_b
"""
if cost_matrix.size == 0:
return np.empty((0, 2), dtype=int), tuple(range(cost_matrix.shape[0])), tuple(range(cost_matrix.shape[1]))
return (
np.empty((0, 2), dtype=int),
tuple(range(cost_matrix.shape[0])),
tuple(range(cost_matrix.shape[1])),
)
cost_matrix[cost_matrix > thresh] = thresh + 1e-4
row_ind, col_ind = linear_sum_assignment(cost_matrix)