From bb7d42254e944033bc23f94a66a7edf380e76998 Mon Sep 17 00:00:00 2001 From: neuronflow Date: Thu, 1 Feb 2024 15:28:25 +0100 Subject: [PATCH] more todos Signed-off-by: neuronflow --- panoptica/instance_matcher.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/panoptica/instance_matcher.py b/panoptica/instance_matcher.py index 32a927c..0647448 100644 --- a/panoptica/instance_matcher.py +++ b/panoptica/instance_matcher.py @@ -6,7 +6,7 @@ _calc_matching_metric_of_overlapping_labels, _map_labels, ) -from panoptica.metrics import Metric, _Metric +from panoptica.metrics import Metric from panoptica.utils.processing_pair import ( InstanceLabelMap, MatchedInstancePair, @@ -98,6 +98,7 @@ def map_instance_labels( >>> labelmap = [([1, 2], [3, 4]), ([5], [6])] >>> result = map_instance_labels(unmatched_instance_pair, labelmap) """ + # TODO check this protected accesses prediction_arr = processing_pair._prediction_arr ref_labels = processing_pair._ref_labels @@ -185,12 +186,14 @@ def _match_instances( Returns: Instance_Label_Map: The result of the instance matching. """ + # TODO check this protected accesses ref_labels = unmatched_instance_pair._ref_labels # Initialize variables for True Positives (tp) and False Positives (fp) labelmap = InstanceLabelMap() pred_arr, ref_arr = ( + # TODO check this protected accesses unmatched_instance_pair._prediction_arr, unmatched_instance_pair._reference_arr, ) @@ -259,6 +262,7 @@ def _match_instances( Returns: Instance_Label_Map: The result of the instance matching. """ + # TODO check this protected accesses ref_labels = unmatched_instance_pair._ref_labels # pred_labels = unmatched_instance_pair._pred_labels @@ -267,11 +271,15 @@ def _match_instances( score_ref: dict[int, float] = {} pred_arr, ref_arr = ( + # TODO check this protected accesses unmatched_instance_pair._prediction_arr, unmatched_instance_pair._reference_arr, ) mm_pairs = _calc_matching_metric_of_overlapping_labels( - pred_arr, ref_arr, ref_labels, matching_metric=self.matching_metric + prediction_arr=pred_arr, + reference_arr=ref_arr, + ref_labels=ref_labels, + matching_metric=self.matching_metric, ) # Loop through matched instances to compute PQ components