:orphan: :py:mod:`traccuracy.matchers._matched` ====================================== .. py:module:: traccuracy.matchers._matched Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: traccuracy.matchers._matched.Matched .. py:class:: Matched(gt_graph: traccuracy._tracking_graph.TrackingGraph, pred_graph: traccuracy._tracking_graph.TrackingGraph, mapping: list[tuple[Any, Any]], matcher_info: dict) Data class storing gt graph, pred graph, computed mapping, and matcher info. The computed mapping type (e.g. one-to-one) is computed in the matched object. :ivar gt_pred_map: A dictionary from gt node to list of matched pred nodes :ivar pred_gt_map: A dictionary from pred node to list of matched gt nodes :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 :param mapping: List of tuples where each tuple maps a gt node to a pred node :type mapping: list[tuple[Any, Any]] :param matcher_info: Dictionary containing name and parameters from the matcher that generated the mapping :type matcher_info: dict .. py:property:: matching_type :type: str Determines the matching type from gt to pred: one-to-one, one-to-many, many-to-one, many-to-many .. py:method:: get_gt_pred_match(gt_node: collections.abc.Hashable) -> collections.abc.Hashable | None Looks for a single pred node matched to a gt node Assumes the matching is one-to-one :param gt_node: ground truth node :type gt_node: Hashable :returns: Predicted node id if there is a match or none if there is no match :rtype: Hashable | None .. py:method:: get_pred_gt_match(pred_node: collections.abc.Hashable) -> collections.abc.Hashable | None Looks for a single gt node that matches a pred node :param pred_node: predicted node id :type pred_node: Hashable :returns: Ground truth node id if there is a match or none if there is no match :rtype: Hashable | None .. py:method:: get_gt_pred_matches(gt_node: collections.abc.Hashable) -> list[collections.abc.Hashable] Look for predicted node matches to a gt node :param gt_node: Ground truth node id :type gt_node: Hashable :returns: List of matching predicted nodes :rtype: list(Hashable) .. py:method:: get_pred_gt_matches(pred_node: collections.abc.Hashable) -> list[collections.abc.Hashable] Look for gt node matches to a predicted node :param pred_node: Predicted node ID :type pred_node: Hashable :returns: List of matching ground truth nodes :rtype: list(hashable)