Skip to content

Commit

Permalink
revert: remove label of traffic light for crossswalk
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 committed Nov 21, 2023
1 parent 6c02b72 commit b41e743
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
7 changes: 2 additions & 5 deletions perception_eval/perception_eval/common/dataset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 3 additions & 8 deletions perception_eval/perception_eval/common/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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:
Expand Down
21 changes: 4 additions & 17 deletions perception_eval/test/perception_lsim2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit b41e743

Please sign in to comment.