Skip to content

Commit

Permalink
Add logger and skip unnecessary division annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
msschwartz21 committed Sep 8, 2023
1 parent 7766f0a commit 72ce528
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/traccuracy/track_errors/divisions.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import copy
import itertools
import logging
from collections import Counter

from traccuracy._tracking_graph import NodeAttr, TrackingGraph
from traccuracy._utils import find_gt_node_matches, find_pred_node_matches

logger = logging.getLogger(__name__)


def _classify_divisions(G_gt, G_pred, mapper):
"""Identify each division as a true positive, false positive or false negative
Expand All @@ -25,6 +28,10 @@ def _classify_divisions(G_gt, G_pred, mapper):
if not isinstance(G_gt, TrackingGraph) or not isinstance(G_pred, TrackingGraph):
raise TypeError("G_gt and G_pred must be TrackingGraph objects")

if G_gt.division_annotations and G_pred.division_annotations:
logger.info("Divison annotations already present. Skipping graph annotation.")
return

# Check that mapper is one to one
if len(mapper) != len({pair[0] for pair in mapper}) or len(mapper) != len(
{pair[1] for pair in mapper}
Expand Down

0 comments on commit 72ce528

Please sign in to comment.