Skip to content

feat(perception_utils): add detection class remapper and BEV NMS - #12786

Merged
amadeuszsz merged 6 commits into
autowarefoundation:mainfrom
amadeuszsz:feat/add-nms-and-remapper-to-utils
Jun 16, 2026
Merged

amadeuszsz merged 6 commits into
autowarefoundation:mainfrom
amadeuszsz:feat/add-nms-and-remapper-to-utils

Conversation

@amadeuszsz

Copy link
Copy Markdown
Contributor

Description

Adds shared detection post-processing utilities to perception_utils so that perception detectors can reuse a single implementation instead of maintaining duplicated per-package copies.

  • DetectionClassRemapper (detection_class_remapper.{hpp,cpp}) - remaps detection labels by BEV area thresholds, operating on autoware_perception_msgs::msg::DetectedObjects.
  • IouBevNms (iou_bev_nms.{hpp,cpp}) - BEV IoU non-maximum suppression with optional score sorting and pedestrian-vs-other-class separation.
  • GTest coverage for both in test/test_detection_utils.cpp (5 cases).

Related links

Parent Issue:

  • Link

How was this PR tested?

colcon test --packages-select perception_utils - test_detection_utils runs 5 cases, all pass.

Notes for reviewers

Porting existing detectors to these shared utilities will be done in separate PRs. Packages to be affected: autoware_bevfusion, autoware_camera_streampetr, autoware_image_projection_based_fusion (pointpainting fusion), autoware_lidar_centerpoint, autoware_lidar_transfusion, and autoware_ptv3.

Circle NMS is written in CUDA and shall be addressed in a separate new package autoware_cuda_perception_utils.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
@amadeuszsz
amadeuszsz requested review from manato and mojomex June 15, 2026 08:04
@amadeuszsz amadeuszsz self-assigned this Jun 15, 2026
@github-actions github-actions Bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jun 15, 2026
@amadeuszsz amadeuszsz added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b730105a57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

…finite params

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

@mojomex mojomex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Basically LGTM, with only some minor change requests (mainly: split tests).

I compared the four files with their BEVFusion equivalents, algorithms check out 👍

@codecov

codecov Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.11111% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 5.09%. Comparing base (13866c4) to head (c9f2995).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
perception/perception_utils/src/iou_bev_nms.cpp 59.25% 0 Missing and 11 partials ⚠️
.../perception_utils/src/detection_class_remapper.cpp 65.38% 2 Missing and 7 partials ⚠️
...lude/perception_utils/detection_class_remapper.hpp 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #12786       +/-   ##
===========================================
- Coverage   19.55%    5.09%   -14.46%     
===========================================
  Files        1903       57     -1846     
  Lines      131616     3691   -127925     
  Branches    46122     1659    -44463     
===========================================
- Hits        25731      188    -25543     
+ Misses      84911     3415    -81496     
+ Partials    20974       88    -20886     
Flag Coverage Δ
full-suite 5.09% <61.11%> (-14.46%) ⬇️

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
@amadeuszsz
amadeuszsz enabled auto-merge (squash) June 16, 2026 07:17

@mojomex mojomex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! There's a duplicated test helper function, but it's small enough so it's not a blocker.

@amadeuszsz
amadeuszsz disabled auto-merge June 16, 2026 07:33
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
@amadeuszsz
amadeuszsz enabled auto-merge (squash) June 16, 2026 07:59
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
@mojomex

mojomex commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@amadeuszsz test_utils.hpp shares its name with the pre-existing test_utils.cpp, causing pre-commit to complain:

cpplint..................................................................Failed
- hook id: cpplint
- exit code: 1

perception/perception_utils/test/test_utils.cpp:15:  perception/perception_utils/test/test_utils.cpp should include its header file perception/perception_utils/test/test_utils.hpp  [build/include] [5]
Done processing perception/perception_utils/test/test_utils.cpp

Renaming one of the two to something else seems like the easiest fix.

@amadeuszsz
amadeuszsz merged commit 98d09b0 into autowarefoundation:main Jun 16, 2026
31 of 32 checks passed
@github-project-automation github-project-automation Bot moved this from To Triage to Done in Software Working Group Jun 16, 2026
tier4-autoware-public-bot Bot pushed a commit to tier4/autoware_universe_perception that referenced this pull request Jun 16, 2026
…owarefoundation/autoware_universe#12786)

* feat(perception_utils): add detection class remapper and BEV NMS

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* fix(perception_utils): keep NMS source objects intact and reject non-finite params

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* style(pre-commit): autofix

* refactor(preception_utils): split tests

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* refactor(perception_utils): test utils

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

---------

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@amadeuszsz
amadeuszsz deleted the feat/add-nms-and-remapper-to-utils branch June 16, 2026 10:31
YoshiRi added a commit to tier4/autoware_universe that referenced this pull request Jun 30, 2026
badai-nguyen pushed a commit to tier4/autoware_universe that referenced this pull request Jul 7, 2026
…owarefoundation#12786)

* feat(perception_utils): add detection class remapper and BEV NMS

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* fix(perception_utils): keep NMS source objects intact and reject non-finite params

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* style(pre-commit): autofix

* refactor(preception_utils): split tests

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* refactor(perception_utils): test utils

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

---------

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Aug 10, 2026
…owarefoundation#12786)

* feat(perception_utils): add detection class remapper and BEV NMS

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* fix(perception_utils): keep NMS source objects intact and reject non-finite params

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* style(pre-commit): autofix

* refactor(preception_utils): split tests

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* refactor(perception_utils): test utils

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

---------

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Signed-off-by: TetsuKawa <kawaguchitnon@icloud.com>
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Sep 7, 2026
…owarefoundation#12786)

* feat(perception_utils): add detection class remapper and BEV NMS

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* fix(perception_utils): keep NMS source objects intact and reject non-finite params

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* style(pre-commit): autofix

* refactor(preception_utils): split tests

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* refactor(perception_utils): test utils

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

---------

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Signed-off-by: TetsuKawa <kawaguchitnon@icloud.com>
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Sep 7, 2026
…owarefoundation#12786)

* feat(perception_utils): add detection class remapper and BEV NMS

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* fix(perception_utils): keep NMS source objects intact and reject non-finite params

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* style(pre-commit): autofix

* refactor(preception_utils): split tests

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* refactor(perception_utils): test utils

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

---------

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
TetsuKawa pushed a commit to TetsuKawa/autoware_universe that referenced this pull request Sep 15, 2026
…owarefoundation#12786)

* feat(perception_utils): add detection class remapper and BEV NMS

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* fix(perception_utils): keep NMS source objects intact and reject non-finite params

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* style(pre-commit): autofix

* refactor(preception_utils): split tests

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

* refactor(perception_utils): test utils

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

---------

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants