:orphan: :py:mod:`traccuracy.matchers._iou` ================================== .. py:module:: traccuracy.matchers._iou Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: traccuracy.matchers._iou.IOUMatcher Functions ~~~~~~~~~ .. autoapisummary:: traccuracy.matchers._iou.match_iou .. py:function:: match_iou(gt: traccuracy._tracking_graph.TrackingGraph, pred: traccuracy._tracking_graph.TrackingGraph, threshold: float = 0.6, one_to_one: bool = False) -> list[tuple[collections.abc.Hashable, collections.abc.Hashable]] Identifies pairs of cells between gt and pred that have iou > threshold This can return more than one match for any node Assumes that within a frame, each object has a unique segmentation label and that the label is recorded on each node using label_key :param gt: Tracking data object containing graph and segmentations :type gt: traccuracy.TrackingGraph :param pred: Tracking data object containing graph and segmentations :type pred: traccuracy.TrackingGraph :param threshold: Minimum IoU for matching cells. Defaults to 0.6. :type threshold: float, optional :param one_to_one: If True, forces the mapping to be one-to-one by running linear assignment on the thresholded iou array. Default False. :type one_to_one: optional, bool :returns: list of tuples where each tuple contains a gt node and pred node :rtype: list[(gt_node, pred_node)] :raises ValueError: gt and pred must be a TrackingData object :raises ValueError: GT and pred segmentations must be the same shape .. py:class:: IOUMatcher(iou_threshold: float = 0.6, one_to_one: bool = False) Constructs a mapping between gt and pred nodes using the IoU of the segmentations Lower values for iou_threshold will be more permissive of imperfect matches :param iou_threshold: Minimum IoU value to assign a match. Defaults to 0.6. :type iou_threshold: float, optional :param one_to_one: If True, forces the mapping to be one-to-one by running linear assignment on the thresholded iou array. Default False. :type one_to_one: optional, bool .. py:property:: info :type: dict[str, Any] Dictionary of Matcher name and any parameters .. py:method:: compute_mapping(gt_graph: traccuracy._tracking_graph.TrackingGraph, pred_graph: traccuracy._tracking_graph.TrackingGraph) -> traccuracy.matchers._matched.Matched Run the matching on a given set of gt and pred TrackingGraph and returns a Matched object with a new copy of each TrackingGraph :param gt_graph: Tracking graph object for the gt :type gt_graph: traccuracy.TrackingGraph :param pred_graph: Tracking graph object for the pred :type pred_graph: traccuracy.TrackingGraph :returns: Matched data object :rtype: matched (traccuracy.matchers.Matched) :raises ValueError: gt and pred must be a TrackingGraph object