Skip to content

feat(autoware_ml): add t4segmetric#195

Merged
amadeuszsz merged 25 commits intotier4:mainfrom
amadeuszsz:feat/t4segmetric-v2
Mar 25, 2026
Merged

feat(autoware_ml): add t4segmetric#195
amadeuszsz merged 25 commits intotier4:mainfrom
amadeuszsz:feat/t4segmetric-v2

Conversation

@amadeuszsz
Copy link
Collaborator

Summary

Add T4SegMetric - a unified segmentation evaluation module shared by PTv3 and FRNet. It computes per-class and mean IoU, precision, recall, F1, and optionally BEV distance-range-based metrics with confusion matrix visualization and TensorBoard logging.

Change point

  • New t4_seg_eval functional core (autoware_ml/segmentation3d/evaluation/functional/t4_seg_eval.py): shared evaluation logic producing SegEvalResult (metrics dict, confusion matrix, per-range CMs). Includes fast_hist, per_class_iou/precision/recall/f1, plot_confusion_matrix, and range-based BEV bucketing.
  • New T4SegMetric MMEngine metric (autoware_ml/segmentation3d/evaluation/metrics/t4_seg_metric.py): BaseMetric subclass wrapping t4_seg_eval for FRNet runner integration with optional confusion matrix image logging.
  • PTv3 evaluator/tester updated (projects/PTv3/engines/hooks/evaluator.py, projects/PTv3/engines/test.py): replaced inline metric computation with t4_seg_eval, added range-based metric and confusion matrix TensorBoard logging.
  • FRNet configs updated (projects/FRNet/configs/t4dataset/frnet_1xb8_t4dataset-{ot,qt}128-seg.py): switched from SegMetric to T4SegMetric with distance_ranges.

Note

Test performed

  • Log
Log output

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
@amadeuszsz amadeuszsz requested a review from mojomex March 16, 2026 02:14
@amadeuszsz amadeuszsz self-assigned this Mar 16, 2026
@amadeuszsz amadeuszsz requested a review from KSeangTan as a code owner March 16, 2026 02:14
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a shared 3D segmentation evaluation core (t4_seg_eval) and integrates it into both PTv3 evaluation/test flows and FRNet/MMEngine via a new T4SegMetric, including optional BEV distance-range breakdown and confusion-matrix visualization/logging.

Changes:

  • Introduced autoware_ml.segmentation3d.evaluation.functional.t4_seg_eval with unified metrics (IoU/acc/precision/recall/F1), confusion matrices, and optional range bucketing.
  • Added autoware_ml.segmentation3d.evaluation.metrics.T4SegMetric (MMEngine BaseMetric) wrapping the functional core and logging CM images.
  • Updated PTv3 evaluator/tester and FRNet configs to use the shared evaluator + distance-range options.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
projects/PTv3/engines/test.py Switches PTv3 test-time evaluation to t4_seg_eval and adds TensorBoard + CM/range logging.
projects/PTv3/engines/hooks/evaluator.py Refactors PTv3 validation evaluator to t4_seg_eval + range/CM logging.
projects/PTv3/configs/semseg-pt-v3m1-0-t4dataset.py Adds metric_options.distance_ranges for PTv3 runs.
projects/FRNet/configs/t4dataset/frnet_1xb8_t4dataset-qt128-seg.py Uses T4SegMetric with distance ranges and updates hooks config.
projects/FRNet/configs/t4dataset/frnet_1xb8_t4dataset-ot128-seg.py Uses T4SegMetric with distance ranges and updates hooks config.
projects/FRNet/configs/nuscenes/frnet_1xb4_nus-seg.py Updates hooks config to include LoggerHook and save_best='miou'.
autoware_ml/segmentation3d/evaluation/functional/t4_seg_eval.py New unified functional evaluator + plotting/helpers.
autoware_ml/segmentation3d/evaluation/metrics/t4_seg_metric.py New MMEngine metric adapter with optional CM image logging + submission export.
autoware_ml/segmentation3d/evaluation/init.py Exposes evaluation public API (t4_seg_eval, T4SegMetric, helpers).
autoware_ml/segmentation3d/evaluation/functional/init.py Exposes functional helpers.
autoware_ml/segmentation3d/evaluation/metrics/init.py Exposes T4SegMetric.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

amadeuszsz and others added 13 commits March 17, 2026 22:06
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
…mplicit spconv load

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

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
@amadeuszsz
Copy link
Collaborator Author

@codex review

Copy link

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

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: e45c323055

ℹ️ 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".

…SegMetric

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

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

@KSeangTan KSeangTan left a comment

Choose a reason for hiding this comment

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

LGTM overall

Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
@amadeuszsz amadeuszsz merged commit d76e8b4 into tier4:main Mar 25, 2026
2 checks passed
@amadeuszsz amadeuszsz deleted the feat/t4segmetric-v2 branch March 25, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants