Skip to content

Commit

Permalink
Handle unmatched nodes in checking successors
Browse files Browse the repository at this point in the history
  • Loading branch information
cmalinmayor committed Aug 6, 2024
1 parent 2afa429 commit dfeed41
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/traccuracy/track_errors/divisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def _correct_shifted_divisions(matched_data: Matched, n_frames=1):
for node in g_pred.graph.successors(fp_node)
]
fn_succ = g_gt.graph.successors(fn_node)
fn_succ_mapped = [gt_to_pred_dict[fn] for fn in fn_succ]
fn_succ_mapped = [
gt_to_pred_dict[fn] for fn in fn_succ if fn in gt_to_pred_dict
]
if Counter(fp_succ) != Counter(fn_succ_mapped):
# Daughters don't match so division cannot match
continue
Expand All @@ -225,7 +227,9 @@ def _correct_shifted_divisions(matched_data: Matched, n_frames=1):
]
fp_succ = g_pred.graph.successors(fp_node)

fp_succ_mapped = [pred_to_gt_dict[fp] for fp in fp_succ]
fp_succ_mapped = [
pred_to_gt_dict[fp] for fp in fp_succ if fp in pred_to_gt_dict
]
if Counter(fp_succ_mapped) != Counter(fn_succ):
# Daughters don't match so division cannot match
continue
Expand Down

1 comment on commit dfeed41

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Mean (s) BASE 9475cb2 Mean (s) HEAD dfeed41 Percent Change
test_load_gt_data 1.20237 1.20284 0.04
test_load_pred_data 1.10334 1.1132 0.89
test_ctc_checks 0.39935 0.3939 -1.36
test_ctc_matched 1.69269 1.7284 2.11
test_ctc_metrics 0.50152 0.4915 -2
test_ctc_div_metrics 0.26196 0.26125 -0.27
test_iou_matched 8.35847 8.89298 6.39
test_iou_div_metrics 0.26886 0.26774 -0.42

Please sign in to comment.