utils
sleap_nn.tracking.utils
¶
Helper functions for Tracker module.
Functions:
Name | Description |
---|---|
compute_cosine_sim |
Return cosine simalirity between a and b vectors. |
compute_euclidean_distance |
Return the negative euclidean distance between a and b points. |
compute_iou |
Return the intersection over union for given a and b bounding boxes [xmin, ymin, xmax, ymax]. |
get_bbox |
Return the bounding box coordinates for the |
get_centroid |
Return the centroid of the |
get_keypoints |
Return keypoints as np.array from the |
greedy_matching |
Match new instances to existing tracks using greedy bipartite matching. |
hungarian_matching |
Match new instances to existing tracks using Hungarian matching. |
compute_cosine_sim(a, b)
¶
Return cosine simalirity between a and b vectors.
compute_euclidean_distance(a, b)
¶
compute_iou(a, b)
¶
Return the intersection over union for given a and b bounding boxes [xmin, ymin, xmax, ymax].
Source code in sleap_nn/tracking/utils.py
get_bbox(pred_instance)
¶
Return the bounding box coordinates for the PredictedInstance
object.
Source code in sleap_nn/tracking/utils.py
get_centroid(pred_instance)
¶
Return the centroid of the PredictedInstance
object.
Source code in sleap_nn/tracking/utils.py
get_keypoints(pred_instance)
¶
Return keypoints as np.array from the PredictedInstance
object.
greedy_matching(cost_matrix)
¶
Match new instances to existing tracks using greedy bipartite matching.
Source code in sleap_nn/tracking/utils.py
hungarian_matching(cost_matrix)
¶
Match new instances to existing tracks using Hungarian matching.