Skip to content

Commit

Permalink
asso func created initalized on first frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikel Broström committed Sep 26, 2024
1 parent 817f097 commit 175ab98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions boxmot/utils/association.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from boxmot.utils.iou import iou_batch, centroid_batch, run_asso_func
from boxmot.utils.iou import AssociationFunction


def speed_direction_batch(dets, tracks):
Expand Down Expand Up @@ -40,7 +40,7 @@ def associate_detections_to_trackers(detections, trackers, iou_threshold=0.3):
np.empty((0, 5), dtype=int),
)

iou_matrix = iou_batch(detections, trackers)
iou_matrix = AssociationFunction.iou_batch(detections, trackers)

if min(iou_matrix.shape) > 0:
a = (iou_matrix > iou_threshold).astype(np.int32)
Expand Down Expand Up @@ -143,7 +143,7 @@ def associate(
valid_mask = np.ones(previous_obs.shape[0])
valid_mask[np.where(previous_obs[:, 4] < 0)] = 0

iou_matrix = run_asso_func(asso_func, detections, trackers, w, h)
iou_matrix = asso_func(detections, trackers)
#iou_matrix = iou_batch(detections, trackers)
scores = np.repeat(detections[:, -1][:, np.newaxis], trackers.shape[0], axis=1)
# iou_matrix = iou_matrix * scores # a trick sometiems works, we don't encourage this
Expand Down Expand Up @@ -235,7 +235,7 @@ def associate_kitti(
"""
Cost from IoU
"""
iou_matrix = iou_batch(detections, trackers)
iou_matrix = AssociationFunction.iou_batch(detections, trackers)

"""
With multiple categories, generate the cost for catgory mismatch
Expand Down

0 comments on commit 175ab98

Please sign in to comment.