diff --git a/perception_eval/perception_eval/evaluation/result/object_result.py b/perception_eval/perception_eval/evaluation/result/object_result.py index 0d5ff1bb..5d8b3bfe 100644 --- a/perception_eval/perception_eval/evaluation/result/object_result.py +++ b/perception_eval/perception_eval/evaluation/result/object_result.py @@ -421,6 +421,7 @@ def _get_object_results_for_tlr( estimated_objects_ = estimated_objects.copy() ground_truth_objects_ = ground_truth_objects.copy() # 1. matching based on same label primary + # NOTE: current implementation match Est/Gt pairs without considering ID, therefore it might not be right result for est_object in estimated_objects: for gt_object in ground_truth_objects: if est_object.uuid is None or gt_object.uuid is None: @@ -428,11 +429,7 @@ def _get_object_results_for_tlr( f"uuid of estimation and ground truth must be set, but got {est_object.uuid} and {gt_object.uuid}" ) - if ( - est_object.uuid == gt_object.uuid - and est_object.frame_id == gt_object.frame_id - and est_object.semantic_label == gt_object.semantic_label - ): + if est_object.semantic_label == gt_object.semantic_label and est_object.frame_id == gt_object.frame_id and est_object in estimated_objects_ and gt_object in ground_truth_objects_: object_results.append( DynamicObjectWithPerceptionResult( estimated_object=est_object, @@ -441,6 +438,7 @@ def _get_object_results_for_tlr( ) estimated_objects_.remove(est_object) ground_truth_objects_.remove(gt_object) + # 2. matching based on same ID rest_estimated_objects_ = estimated_objects_.copy() rest_ground_truth_objects_ = ground_truth_objects_.copy() @@ -451,7 +449,7 @@ def _get_object_results_for_tlr( f"uuid of estimation and ground truth must be set, but got {est_object.uuid} and {gt_object.uuid}" ) - if est_object.uuid == gt_object.uuid and est_object.frame_id == gt_object.frame_id: + if est_object.uuid == gt_object.uuid and est_object.frame_id == gt_object.frame_id and est_object in estimated_objects_ and gt_object in ground_truth_objects_: object_results.append( DynamicObjectWithPerceptionResult( estimated_object=est_object,