From 62aac18eefa541bd0ecb26809d25e362e58c2d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Zeren?= Date: Fri, 23 Aug 2024 12:52:31 +0300 Subject: [PATCH 1/6] feat: add message definition for instance segmentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Barış Zeren --- CMakeLists.txt | 3 +++ msg/Segmentation.msg | 3 +++ msg/SegmentationConfig.msg | 16 ++++++++++++++++ package.xml | 1 + 4 files changed, 23 insertions(+) create mode 100644 msg/Segmentation.msg create mode 100644 msg/SegmentationConfig.msg diff --git a/CMakeLists.txt b/CMakeLists.txt index fd210e1..ae78d77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,14 @@ set(msg_files "msg/PublishedTime.msg" "msg/MissionRemainingDistanceTime.msg" "msg/ResourceUsageReport.msg" + "msg/Segmentation.msg" + "msg/SegmentationConfig.msg" ) set(msg_dependencies builtin_interfaces std_msgs + sensor_msgs ) rosidl_generate_interfaces(${PROJECT_NAME} diff --git a/msg/Segmentation.msg b/msg/Segmentation.msg new file mode 100644 index 0000000..35b93ed --- /dev/null +++ b/msg/Segmentation.msg @@ -0,0 +1,3 @@ +SegmentationConfig config # Stores relation between class and image intensity + +sensor_msgs/Image image # Mask image \ No newline at end of file diff --git a/msg/SegmentationConfig.msg b/msg/SegmentationConfig.msg new file mode 100644 index 0000000..425263a --- /dev/null +++ b/msg/SegmentationConfig.msg @@ -0,0 +1,16 @@ +uint8 UNKNOWN=0 +uint8 CAR=1 +uint8 TRUCK=2 +uint8 BUS=3 +uint8 BICYCLE=4 +uint8 MOTORBIKE=5 +uint8 PEDESTRIAN=6 +uint8 ANIMAL=7 + +# It represent map between instance segmentation mask and classes +# The pixel intensities in mask's starts with 1 (pixel value 0 represent pixel is not belong any object) +# `class_array[0]` returns the `class_id` for pixels with an intensity value of `1` in the mask. +# `class_array[1]` returns the `class_id` for pixels with an intensity value of `2` in the mask. +# ... +# The relationship between pixels and class IDs continues in this way. +uint8[] class_array \ No newline at end of file diff --git a/package.xml b/package.xml index adc2901..5414ba7 100644 --- a/package.xml +++ b/package.xml @@ -17,6 +17,7 @@ rosidl_default_runtime builtin_interfaces std_msgs + sensor_msgs ament_lint_auto ament_lint_common From cd6e060489bd09ee05d02b262dde6a5137097543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Zeren?= Date: Fri, 23 Aug 2024 14:25:20 +0300 Subject: [PATCH 2/6] chore: change name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Barış Zeren chore: change name Signed-off-by: Barış Zeren --- CMakeLists.txt | 2 +- msg/SegmentationConfig.msg | 6 +++--- msg/{Segmentation.msg => SegmentationMask.msg} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename msg/{Segmentation.msg => SegmentationMask.msg} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae78d77..78ece95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(msg_files "msg/PublishedTime.msg" "msg/MissionRemainingDistanceTime.msg" "msg/ResourceUsageReport.msg" - "msg/Segmentation.msg" + "msg/SegmentationMask.msg" "msg/SegmentationConfig.msg" ) diff --git a/msg/SegmentationConfig.msg b/msg/SegmentationConfig.msg index 425263a..e5a9729 100644 --- a/msg/SegmentationConfig.msg +++ b/msg/SegmentationConfig.msg @@ -9,8 +9,8 @@ uint8 ANIMAL=7 # It represent map between instance segmentation mask and classes # The pixel intensities in mask's starts with 1 (pixel value 0 represent pixel is not belong any object) -# `class_array[0]` returns the `class_id` for pixels with an intensity value of `1` in the mask. -# `class_array[1]` returns the `class_id` for pixels with an intensity value of `2` in the mask. +# `class_ids[0]` returns the `class_id` for pixels with an intensity value of `1` in the mask. +# `class_ids[1]` returns the `class_id` for pixels with an intensity value of `2` in the mask. # ... # The relationship between pixels and class IDs continues in this way. -uint8[] class_array \ No newline at end of file +uint8[] class_ids \ No newline at end of file diff --git a/msg/Segmentation.msg b/msg/SegmentationMask.msg similarity index 100% rename from msg/Segmentation.msg rename to msg/SegmentationMask.msg From 7a05295ca458ae79984f89121edfbf742f53f4db Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 16:33:14 +0000 Subject: [PATCH 3/6] style(pre-commit): autofix --- msg/SegmentationConfig.msg | 2 +- msg/SegmentationMask.msg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msg/SegmentationConfig.msg b/msg/SegmentationConfig.msg index e5a9729..cd7f33e 100644 --- a/msg/SegmentationConfig.msg +++ b/msg/SegmentationConfig.msg @@ -13,4 +13,4 @@ uint8 ANIMAL=7 # `class_ids[1]` returns the `class_id` for pixels with an intensity value of `2` in the mask. # ... # The relationship between pixels and class IDs continues in this way. -uint8[] class_ids \ No newline at end of file +uint8[] class_ids diff --git a/msg/SegmentationMask.msg b/msg/SegmentationMask.msg index 35b93ed..836f7d6 100644 --- a/msg/SegmentationMask.msg +++ b/msg/SegmentationMask.msg @@ -1,3 +1,3 @@ SegmentationConfig config # Stores relation between class and image intensity -sensor_msgs/Image image # Mask image \ No newline at end of file +sensor_msgs/Image image # Mask image From 5088bf17c3e3a384d1d4656bf58a2360f535289e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Zeren?= Date: Mon, 2 Sep 2024 17:47:43 +0300 Subject: [PATCH 4/6] chore: add header to mask message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Barış Zeren --- msg/SegmentationMask.msg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/msg/SegmentationMask.msg b/msg/SegmentationMask.msg index 836f7d6..1ce1010 100644 --- a/msg/SegmentationMask.msg +++ b/msg/SegmentationMask.msg @@ -1,3 +1,5 @@ +std_msgs/Header header + SegmentationConfig config # Stores relation between class and image intensity sensor_msgs/Image image # Mask image From 30f974fa7513566b20fa04e5bf8fd87f0b119dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Zeren?= Date: Sat, 7 Sep 2024 18:11:30 +0300 Subject: [PATCH 5/6] chore: change class array with objects classification type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Barış Zeren --- CMakeLists.txt | 1 + msg/SegmentationConfig.msg | 19 +++++-------------- package.xml | 1 + 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78ece95..7d292d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ set(msg_dependencies builtin_interfaces std_msgs sensor_msgs + autoware_perception_msgs ) rosidl_generate_interfaces(${PROJECT_NAME} diff --git a/msg/SegmentationConfig.msg b/msg/SegmentationConfig.msg index cd7f33e..756979c 100644 --- a/msg/SegmentationConfig.msg +++ b/msg/SegmentationConfig.msg @@ -1,16 +1,7 @@ -uint8 UNKNOWN=0 -uint8 CAR=1 -uint8 TRUCK=2 -uint8 BUS=3 -uint8 BICYCLE=4 -uint8 MOTORBIKE=5 -uint8 PEDESTRIAN=6 -uint8 ANIMAL=7 - -# It represent map between instance segmentation mask and classes +# It represent map between instance segmentation mask and labels # The pixel intensities in mask's starts with 1 (pixel value 0 represent pixel is not belong any object) -# `class_ids[0]` returns the `class_id` for pixels with an intensity value of `1` in the mask. -# `class_ids[1]` returns the `class_id` for pixels with an intensity value of `2` in the mask. +# `classification[0]` returns the `label_id` for pixels with an intensity value of `1` in the mask. +# `classification[1]` returns the `label_id` for pixels with an intensity value of `2` in the mask. # ... -# The relationship between pixels and class IDs continues in this way. -uint8[] class_ids +# The relationship between pixels and label IDs continues in this way. +autoware_perception_msgs/ObjectClassification[] classification diff --git a/package.xml b/package.xml index 5414ba7..b22f82c 100644 --- a/package.xml +++ b/package.xml @@ -18,6 +18,7 @@ builtin_interfaces std_msgs sensor_msgs + autoware_perception_msgs ament_lint_auto ament_lint_common From 8a35861dbfe06e459d19e167efe4a1a6037853d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Zeren?= Date: Tue, 26 Nov 2024 19:31:31 +0300 Subject: [PATCH 6/6] refactor: replace classification array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Barış Zeren --- CMakeLists.txt | 1 - msg/SegmentationConfig.msg | 7 ------- msg/SegmentationMask.msg | 8 +++++++- 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 msg/SegmentationConfig.msg diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d292d1..3b83218 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ set(msg_files "msg/MissionRemainingDistanceTime.msg" "msg/ResourceUsageReport.msg" "msg/SegmentationMask.msg" - "msg/SegmentationConfig.msg" ) set(msg_dependencies diff --git a/msg/SegmentationConfig.msg b/msg/SegmentationConfig.msg deleted file mode 100644 index 756979c..0000000 --- a/msg/SegmentationConfig.msg +++ /dev/null @@ -1,7 +0,0 @@ -# It represent map between instance segmentation mask and labels -# The pixel intensities in mask's starts with 1 (pixel value 0 represent pixel is not belong any object) -# `classification[0]` returns the `label_id` for pixels with an intensity value of `1` in the mask. -# `classification[1]` returns the `label_id` for pixels with an intensity value of `2` in the mask. -# ... -# The relationship between pixels and label IDs continues in this way. -autoware_perception_msgs/ObjectClassification[] classification diff --git a/msg/SegmentationMask.msg b/msg/SegmentationMask.msg index 1ce1010..957c02e 100644 --- a/msg/SegmentationMask.msg +++ b/msg/SegmentationMask.msg @@ -1,5 +1,11 @@ std_msgs/Header header -SegmentationConfig config # Stores relation between class and image intensity +# It represent map between instance segmentation mask and labels +# The pixel intensities in mask's starts with 1 (pixel value 0 represent pixel is not belong any object) +# `classification[0]` returns the `label_id` for pixels with an intensity value of `1` in the mask. +# `classification[1]` returns the `label_id` for pixels with an intensity value of `2` in the mask. +# ... +# The relationship between pixels and label IDs continues in this way. +autoware_perception_msgs/ObjectClassification[] classification sensor_msgs/Image image # Mask image