traccuracy.track_errors

Subpackage for annotating errors on nodes and edges of TrackingGraphs

Package Contents

Functions

classify_basic_errors(→ None)

Classify basic node and edge errors in the matched graphs.

evaluate_ctc_events(→ None)

Annotates ground truth and predicted graph with node and edge error types

evaluate_division_events(...)

Classify division errors and correct shifted divisions according to frame_buffer

traccuracy.track_errors.classify_basic_errors(matched: traccuracy.matchers._matched.Matched, relax_skips_gt: bool = False, relax_skips_pred: bool = False) None[source]

Classify basic node and edge errors in the matched graphs.

A pair of GT/pred nodes is classified as true positive if the matching is one-to-one. False positive nodes are all those remaining in the pred graph. False negative nodes are all those remaining in the GT graph.

A pair of GT/pred edges is classified as true positive if both the source and target nodes are true positives, and the GT graph contains the edge. All remaining edges in the GT graph are false negatives, and all remaining edges in the prediction graph are false positives.

Parameters:
  • matched (traccuracy.matchers.Matched) – Matched data object containing gt and pred graphs with their associated mapping

  • relax_skips_gt (bool) – If True, the metric will check if skips in the ground truth graph have an equivalent multi-edge path in predicted graph

  • relax_skips_pred (bool) – If True, the metric will check if skips in the predicted graph have an equivalent multi-edge path in ground truth graph

traccuracy.track_errors.evaluate_ctc_events(matched_data: traccuracy.matchers._matched.Matched) None[source]

Annotates ground truth and predicted graph with node and edge error types

Annotations are made in place

traccuracy.track_errors.evaluate_division_events(matched_data: traccuracy.matchers._matched.Matched, max_frame_buffer: int = 0, relax_skips_gt: bool = False, relax_skips_pred: bool = False) traccuracy.matchers._matched.Matched[source]

Classify division errors and correct shifted divisions according to frame_buffer

Note: A copy of matched_data will be created for each frame_buffer other than 0. For large graphs, creating copies may introduce memory problems.

Parameters:
  • matched_data (traccuracy.matchers.Matched) – Matched data object containing gt and pred graphs with their associated mapping

  • max_frame_buffer (int, optional) – Maximum value of frame buffer to use in correcting shifted divisions. Divisions will be evaluated for all integer values of frame buffer between 0 and max_frame_buffer

  • relax_skips_gt (bool) – If True, the metric will check if skips in the ground truth graph have an equivalent multi-edge path in predicted graph

  • relax_skips_pred (bool) – If True, the metric will check if skips in the predicted graph have an equivalent multi-edge path in ground truth graph

Returns:

Matched data object with annotated FP, FN and TP

divisions, with a min_buffer_correct attribute indicating the minimum frame buffer value that corrects this division, if applicable.

Return type:

matched_data (traccuracy.matchers.Matched)