From b41e74395f029ed03bd39e7ffdd0063877ecca4a Mon Sep 17 00:00:00 2001 From: ktro2828 Date: Tue, 21 Nov 2023 16:57:07 +0900 Subject: [PATCH] revert: remove label of traffic light for crossswalk Signed-off-by: ktro2828 --- .../perception_eval/common/dataset_utils.py | 7 ++----- .../perception_eval/common/label.py | 11 +++------- perception_eval/test/perception_lsim2d.py | 21 ++++--------------- 3 files changed, 9 insertions(+), 30 deletions(-) diff --git a/perception_eval/perception_eval/common/dataset_utils.py b/perception_eval/perception_eval/common/dataset_utils.py index 2d2556c0..43000a37 100644 --- a/perception_eval/perception_eval/common/dataset_utils.py +++ b/perception_eval/perception_eval/common/dataset_utils.py @@ -576,11 +576,8 @@ def _merge_duplicated_traffic_lights( "If the same regulatory element ID is assigned to multiple traffic lights, " f"it must annotated with only two labels: (unknown, another one). But got, {unique_labels}" ) - semantic_label = [ - label - for label in candidate_labels - if label.label != TrafficLightLabel.UNKNOWN and TrafficLightLabel.CROSSWALK_UNKNOWN - ][0] + semantic_label = [label for label in candidate_labels if label.label != TrafficLightLabel.UNKNOWN][0] + assert semantic_label.label != TrafficLightLabel.UNKNOWN merged_object = DynamicObject2D( unix_time=unix_time, frame_id=candidates[0].frame_id, diff --git a/perception_eval/perception_eval/common/label.py b/perception_eval/perception_eval/common/label.py index c2b732c0..2bf27ff1 100644 --- a/perception_eval/perception_eval/common/label.py +++ b/perception_eval/perception_eval/common/label.py @@ -76,11 +76,6 @@ class TrafficLightLabel(Enum): RED_LEFT_DIAGONAL = "red_left_diagonal" RED_RIGHT_DIAGONAL = "red_right_diagonal" - # === for crosswalk === - CROSSWALK_RED = "crosswalk_red" - CROSSWALK_GREEN = "crosswalk_green" - CROSSWALK_UNKNOWN = "crosswalk_unknown" - # unknown is used in both detection and classification UNKNOWN = "unknown" @@ -379,9 +374,9 @@ def _get_traffic_light_paris( (TrafficLightLabel.RED_LEFT_DIAGONAL, "red_left_diagonal"), (TrafficLightLabel.RED_LEFT_DIAGONAL, "red_leftdiagonal"), (TrafficLightLabel.UNKNOWN, "unknown"), - (TrafficLightLabel.CROSSWALK_RED, "crosswalk_red"), - (TrafficLightLabel.CROSSWALK_GREEN, "crosswalk_green"), - (TrafficLightLabel.CROSSWALK_UNKNOWN, "crosswalk_unknown"), + (TrafficLightLabel.RED, "crosswalk_red"), + (TrafficLightLabel.GREEN, "crosswalk_green"), + (TrafficLightLabel.UNKNOWN, "crosswalk_unknown"), (TrafficLightLabel.FP, "false_positive"), ] else: diff --git a/perception_eval/test/perception_lsim2d.py b/perception_eval/test/perception_lsim2d.py index b18a54c6..b274571e 100644 --- a/perception_eval/test/perception_lsim2d.py +++ b/perception_eval/test/perception_lsim2d.py @@ -45,10 +45,7 @@ def __init__( if evaluation_task in ("detection2d", "tracking2d"): evaluation_config_dict = { "evaluation_task": evaluation_task, - "center_distance_thresholds": [ - 100, - 200, - ], # = [[100, 100, 100, 100], [200, 200, 200, 200]] + "center_distance_thresholds": [100, 200], # = [[100, 100, 100, 100], [200, 200, 200, 200]] "iou_2d_thresholds": [0.5], # = [[0.5, 0.5, 0.5, 0.5]] } elif evaluation_task == "classification2d": @@ -59,15 +56,7 @@ def __init__( # If target_labels = None, all labels will be evaluated. evaluation_config_dict.update( dict( - target_labels=[ - "green", - "red", - "yellow", - "unknown", - "crosswalk_green", - "crosswalk_red", - "crosswalk_unknown", - ] + target_labels=["green", "red", "yellow", "unknown"] if label_prefix == "traffic_light" else ["car", "bicycle", "pedestrian", "motorbike"], ignore_attributes=["cycle_state.without_rider"] if label_prefix == "autoware" else None, @@ -114,14 +103,12 @@ def callback( # 1 frameの評価 target_labels = ( - ["green", "red", "yellow", "unknown", "crosswalk_green", "crosswalk_red", "crosswalk_unknown"] + ["green", "red", "yellow", "unknown"] if self.label_prefix == "traffic_light" else ["car", "bicycle", "pedestrian", "motorbike"] ) ignore_attributes = ["cycle_state.without_rider"] if self.label_prefix == "autoware" else None - matching_threshold_list = ( - None if self.evaluation_task == "classification2d" else [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] - ) + matching_threshold_list = None if self.evaluation_task == "classification2d" else [0.5, 0.5, 0.5, 0.5] # 距離などでUC評価objectを選別するためのインターフェイス(PerceptionEvaluationManager初期化時にConfigを設定せず、関数受け渡しにすることで動的に変更可能なInterface) # どれを注目物体とするかのparam critical_object_filter_config: CriticalObjectFilterConfig = CriticalObjectFilterConfig(