merge_matches
Merge two sets of matches and return matched and unmatched indices.
Source code in ultralytics/tracker/utils/matching.py
_indices_to_matches
_indices_to_matches: Return matched and unmatched indices given a cost matrix, indices, and a threshold.
Source code in ultralytics/tracker/utils/matching.py
linear_assignment
Linear assignment implementations with scipy and lap.lapjv.
Source code in ultralytics/tracker/utils/matching.py
ious
Compute cost based on IoU :type atlbrs: list[tlbr] | np.ndarray :type atlbrs: list[tlbr] | np.ndarray
:rtype ious np.ndarray
Source code in ultralytics/tracker/utils/matching.py
iou_distance
Compute cost based on IoU :type atracks: list[STrack] :type btracks: list[STrack]
:rtype cost_matrix np.ndarray
Source code in ultralytics/tracker/utils/matching.py
v_iou_distance
Compute cost based on IoU :type atracks: list[STrack] :type btracks: list[STrack]
:rtype cost_matrix np.ndarray
Source code in ultralytics/tracker/utils/matching.py
embedding_distance
:param tracks: list[STrack] :param detections: list[BaseTrack] :param metric: :return: cost_matrix np.ndarray
Source code in ultralytics/tracker/utils/matching.py
gate_cost_matrix
Apply gating to the cost matrix based on predicted tracks and detected objects.
Source code in ultralytics/tracker/utils/matching.py
fuse_motion
Fuse motion between tracks and detections with gating and Kalman filtering.
Source code in ultralytics/tracker/utils/matching.py
fuse_iou
Fuses ReID and IoU similarity matrices to yield a cost matrix for object tracking.
Source code in ultralytics/tracker/utils/matching.py
fuse_score
Fuses cost matrix with detection scores to produce a single similarity matrix.
Source code in ultralytics/tracker/utils/matching.py
bbox_ious
Calculate the Intersection over Union (IoU) between pairs of bounding boxes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
box1 |
np.array
|
A numpy array of shape (n, 4) representing 'n' bounding boxes. Each row is in the format (x1, y1, x2, y2). |
required |
box2 |
np.array
|
A numpy array of shape (m, 4) representing 'm' bounding boxes. Each row is in the format (x1, y1, x2, y2). |
required |
eps |
float
|
A small constant to prevent division by zero. Defaults to 1e-7. |
1e-07
|
Returns:
Type | Description |
---|---|
np.array
|
A numpy array of shape (n, m) representing the IoU scores for each pair of bounding boxes from box1 and box2. |
Note
The bounding box coordinates are expected to be in the format (x1, y1, x2, y2).
Source code in ultralytics/tracker/utils/matching.py
Created 2023-04-16, Updated 2023-05-17
Authors: Glenn Jocher (3)