From 181947daa583c7facdee369f4112055a331ab4e5 Mon Sep 17 00:00:00 2001 From: ktro2828 Date: Fri, 15 Nov 2024 11:56:57 +0900 Subject: [PATCH] feat: update comparing sensor index and camera index in painting Signed-off-by: ktro2828 --- perception_dataset/deepen/segmentation/painting2d.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perception_dataset/deepen/segmentation/painting2d.py b/perception_dataset/deepen/segmentation/painting2d.py index 2ae4bebf..3f5fd2a6 100644 --- a/perception_dataset/deepen/segmentation/painting2d.py +++ b/perception_dataset/deepen/segmentation/painting2d.py @@ -141,8 +141,9 @@ def _parse_annotation( for image, categories in items.items(): id2category = {i + 1: name for i, name in enumerate(categories)} camera_name = None + # NOTE: camera2index starts from 0, but deepen sensor id starts from 1. for name, sensor_idx in camera2index.items(): - if f"sensor{sensor_idx}" == sensor_id: + if f"sensor{sensor_idx + 1}" == sensor_id: camera_name = name if camera_name is None: raise ValueError(f"There is no corresponding camera for {image}")