From 1cfea1c692e34552863f08865846ab73ffb6c51d Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Fri, 8 May 2026 15:34:39 +0900 Subject: [PATCH] fix inconsistent deepen label fields --- .../utils/dataset/annotation_tool_dataset.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/auto_labeling_3d/utils/dataset/annotation_tool_dataset.py b/tools/auto_labeling_3d/utils/dataset/annotation_tool_dataset.py index 9de0cf66a..0da5a2356 100644 --- a/tools/auto_labeling_3d/utils/dataset/annotation_tool_dataset.py +++ b/tools/auto_labeling_3d/utils/dataset/annotation_tool_dataset.py @@ -109,6 +109,16 @@ def assign_id(self, uuid: str, label: str) -> str: return unique_label_id + def assign_label_category_id(self, uuid: str, label: str) -> str: + """Return the stable label category associated with the UUID's unique ID. + + Tracking can keep one UUID across compatible per-frame class changes (for example, + car/truck). Deepen expects the category to match the class prefix of label_id, so + derive the category from the assigned run-level ID instead of the frame label. + """ + unique_label_id = self.assign_id(uuid, label) + return unique_label_id.rsplit(":", maxsplit=1)[0] + @dataclass(frozen=True) class AnnotationToolDataset: @@ -199,12 +209,14 @@ def _create_annotations_from_info(info: AWML3DInfo, tool_id: str) -> list[dict]: file_id: str = f"{idx}.pcd" for box_global in boxes_in_frame_global: - unique_label_id: str = id_generator.assign_id(box_global.uuid, str(box_global.semantic_label.name)) + label_name = str(box_global.semantic_label.name) + unique_label_id: str = id_generator.assign_id(box_global.uuid, label_name) + label_category_id: str = id_generator.assign_label_category_id(box_global.uuid, label_name) annotation_fields = DeepenAnnotationFields( dataset_id=tool_id, file_id=file_id, - label_category_id=str(box_global.semantic_label.name), + label_category_id=label_category_id, label_id=unique_label_id, label_type="3d_bbox", attributes={"pseudo-label": "auto-labeled"},