forked from wffjwbbf/ComDesignProject
remove 'print' function for debug
This commit is contained in:
parent
10f08f98e9
commit
720b34d532
|
|
@ -12,7 +12,7 @@ __all__ = ['DeepSort']
|
|||
|
||||
|
||||
class DeepSort(object):
|
||||
def __init__(self, model_path, model_config=None, max_dist=0.015, min_confidence=0.3, nms_max_overlap=0.9, max_iou_distance=0.45, max_age=20, n_init=10, nn_budget=1000, use_cuda=True):
|
||||
def __init__(self, model_path, model_config=None, max_dist=0.005, min_confidence=0.3, nms_max_overlap=0.9, max_iou_distance=0.45, max_age=20, n_init=10, nn_budget=1000, use_cuda=True):
|
||||
self.min_confidence = min_confidence
|
||||
self.nms_max_overlap = nms_max_overlap
|
||||
|
||||
|
|
|
|||
|
|
@ -24,18 +24,7 @@ def iou(bbox, candidates):
|
|||
|
||||
"""
|
||||
length = len(candidates)
|
||||
# print("----iou test---------")
|
||||
# print(bbox)
|
||||
# bbox[0] -= bbox[2]
|
||||
# bbox[1] -= bbox[3]
|
||||
# bbox[2] *= 3
|
||||
# bbox[3] *= 3
|
||||
# candidates[:, 0] -= candidates[:, 2]
|
||||
# candidates[:, 1] -= candidates[:, 3]
|
||||
# candidates[:, 2] *= 3
|
||||
# candidates[:, 3] *= 3
|
||||
# print(bbox)
|
||||
# print("----iou test---------")
|
||||
|
||||
bbox_tl, bbox_br = bbox[:2], bbox[:2] + bbox[2:]
|
||||
candidates_tl = candidates[:, :2]
|
||||
candidates_br = candidates[:, :2] + candidates[:, 2:]
|
||||
|
|
@ -49,12 +38,13 @@ def iou(bbox, candidates):
|
|||
area_intersection = wh.prod(axis=1)
|
||||
area_bbox = bbox[2:].prod()
|
||||
area_candidates = candidates[:, 2:].prod(axis=1)
|
||||
|
||||
# should be consious
|
||||
gious = []
|
||||
for i in range(length):
|
||||
gious.append(float((area_bbox + area_candidates[i] - area_intersection[i])/(max(bbox[0]+bbox[2],candidates[i][0]+candidates[i][2])-min(bbox[0],candidates[i][0]))/(max(bbox[1]+bbox[3],candidates[i][1]+candidates[i][3])-min(bbox[1],candidates[i][1]))) )
|
||||
|
||||
# return area_intersection / (area_bbox + area_candidates - area_intersection)
|
||||
print(f"gious:{gious}")
|
||||
print(area_intersection / (area_bbox + area_candidates - area_intersection))
|
||||
return np.array(gious)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ def min_cost_matching(
|
|||
|
||||
cost_matrix = distance_metric(
|
||||
tracks, detections, track_indices, detection_indices)
|
||||
print(f"iou_distance:{cost_matrix}")
|
||||
cost_matrix[cost_matrix > max_distance] = max_distance + 1e-5
|
||||
|
||||
row_indices, col_indices = linear_assignment(cost_matrix)
|
||||
|
|
|
|||
|
|
@ -99,8 +99,6 @@ class Tracker:
|
|||
cost_matrix = linear_assignment.gate_cost_matrix(
|
||||
self.kf, cost_matrix, tracks, dets, track_indices,
|
||||
detection_indices)
|
||||
print("cost:")
|
||||
print(cost_matrix)
|
||||
return cost_matrix
|
||||
|
||||
# Split track set into confirmed and unconfirmed tracks.
|
||||
|
|
|
|||
Loading…
Reference in New Issue