Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions tools/auto_labeling_3d/utils/dataset/annotation_tool_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring why it is [0]



@dataclass(frozen=True)
class AnnotationToolDataset:
Expand Down Expand Up @@ -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"},
Expand Down