Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
9bb04ce
Update docker installation commit for perception_evaluation
KSeangTan Jan 14, 2026
ebee4a0
Merge branch 'tier4:main' into main
KSeangTan Jan 14, 2026
775f1d0
Resolve merge conflicts
KSeangTan Jan 20, 2026
edb373a
Merge branch 'tier4:main' into main
KSeangTan Jan 20, 2026
a358886
Merge branch 'tier4:main' into main
KSeangTan Jan 20, 2026
be329c4
Merge branch 'tier4:main' into main
KSeangTan Jan 21, 2026
6b81116
Merge branch 'tier4:main' into main
KSeangTan Jan 23, 2026
3e3c09d
Merge branch 'tier4:main' into main
KSeangTan Jan 29, 2026
fdeaa33
Merge branch 'tier4:main' into main
KSeangTan Feb 9, 2026
9b71536
Merge branch 'tier4:main' into main
KSeangTan Feb 9, 2026
3b3c734
Merge branch 'tier4:main' into main
KSeangTan Feb 17, 2026
6165a16
Merge branch 'tier4:main' into main
KSeangTan Feb 27, 2026
6d20865
Merge branch 'tier4:main' into main
KSeangTan Feb 27, 2026
0079f71
Merge branch 'tier4:main' into main
KSeangTan Mar 3, 2026
9a1130b
Merge branch 'tier4:main' into main
KSeangTan Mar 4, 2026
94ab3a3
Merge branch 'tier4:main' into main
KSeangTan Mar 6, 2026
cfd5fac
Merge branch 'tier4:main' into main
KSeangTan Mar 17, 2026
e57b46f
Merge branch 'tier4:main' into main
KSeangTan Mar 18, 2026
1a7ebee
Update config
KSeangTan Mar 19, 2026
8402451
Update config
KSeangTan Mar 24, 2026
cf6e13d
Update config
KSeangTan Mar 25, 2026
e1ebc99
Update config
KSeangTan Mar 26, 2026
2dac433
Update config
KSeangTan Mar 27, 2026
9046b7b
Update config
KSeangTan Mar 27, 2026
d4d93fa
Added
KSeangTan Mar 27, 2026
b2714a8
Added
KSeangTan Mar 31, 2026
43adb38
ci(pre-commit): autofix
pre-commit-ci[bot] Mar 31, 2026
73dd1c4
Added
KSeangTan Apr 8, 2026
89e2670
ci(pre-commit): autofix
pre-commit-ci[bot] Apr 8, 2026
dacc863
Merge branch 'tier4:main' into main
KSeangTan Apr 8, 2026
380d7aa
Added
KSeangTan Apr 10, 2026
b60e45a
Update configs
KSeangTan Apr 12, 2026
9b38a42
Added
KSeangTan Apr 13, 2026
f39b584
Updated
KSeangTan Apr 17, 2026
24a88ad
Added
KSeangTan Apr 17, 2026
c637420
Added
KSeangTan Apr 17, 2026
48879b8
ci(pre-commit): autofix
pre-commit-ci[bot] Apr 17, 2026
82457ab
Added
KSeangTan Apr 17, 2026
47d41e0
Added
KSeangTan Apr 17, 2026
827bbb2
Updated
KSeangTan Apr 17, 2026
5f9a4a5
Updated
KSeangTan Apr 17, 2026
1d0ac8d
Added
KSeangTan Apr 18, 2026
a26782a
Updated
KSeangTan Apr 18, 2026
f4c01a5
Updated
KSeangTan Apr 18, 2026
15371af
Update dataset name
KSeangTan Apr 18, 2026
4977b33
Update dataset name
KSeangTan Apr 19, 2026
f85a8e9
Update dataset name
KSeangTan Apr 20, 2026
dd50b12
Merge branch 'tier4:main' into main
KSeangTan Apr 21, 2026
4222ab9
Update configs
KSeangTan Apr 21, 2026
0f5b588
Update configs
KSeangTan Apr 21, 2026
caecca6
Update base docstring
KSeangTan Apr 21, 2026
07c2e11
Update base docstring
KSeangTan Apr 21, 2026
2665b27
Update j6gen2_base and jpntaxi_base docstring
KSeangTan Apr 21, 2026
08b50e6
Add the script
KSeangTan Apr 23, 2026
dead69b
Add the script
KSeangTan Apr 23, 2026
1725f79
Update dataset name
KSeangTan Apr 23, 2026
24d780b
Added
Apr 24, 2026
8175419
Added
Apr 24, 2026
33f11cd
Added
Apr 25, 2026
2237522
Added
Apr 25, 2026
60df4c0
Added
Apr 25, 2026
b5dabf2
Added
Apr 27, 2026
79024cf
Added
Apr 27, 2026
e771a69
Added
Apr 27, 2026
05703cb
Update configs
KSeangTan Apr 27, 2026
06ae9c2
Update configs
KSeangTan Apr 27, 2026
d8c1974
Update configs
KSeangTan Apr 28, 2026
25e581c
Update configs
KSeangTan Apr 28, 2026
9ba440a
Update configs
KSeangTan Apr 28, 2026
aac1e1d
Update configs
KSeangTan Apr 28, 2026
09c06d7
Update configs
KSeangTan Apr 28, 2026
5279b17
Update configs
KSeangTan Apr 28, 2026
0ce7a72
Add the script
KSeangTan Apr 28, 2026
9b4c2f2
Added
Apr 28, 2026
5c0ada8
Add the script
KSeangTan Apr 28, 2026
ad6b07a
Add the script
KSeangTan Apr 28, 2026
a592868
Add the script
KSeangTan Apr 28, 2026
2929ff6
Update configs
KSeangTan Apr 28, 2026
57d6ae6
Update configs
KSeangTan Apr 28, 2026
2e03655
Add the script
KSeangTan Apr 28, 2026
e2a69c1
Add the script
KSeangTan Apr 28, 2026
ebc8034
Update configs
KSeangTan Apr 28, 2026
bb35205
Add the script
KSeangTan Apr 29, 2026
f343fbe
Update configs
KSeangTan Apr 29, 2026
6f55027
Update configs
KSeangTan Apr 29, 2026
d99abd9
Add the script
KSeangTan Apr 30, 2026
b1b247a
Add the script
KSeangTan Apr 30, 2026
36e3811
Add the script
KSeangTan Apr 30, 2026
df3e50c
Merge branch 'tier4:main' into main
KSeangTan May 2, 2026
e905263
Add traffic cone and barrier
KSeangTan May 7, 2026
c429514
Merge branch 'main' into feat/add_traffic_barrier_to_dataset
KSeangTan May 7, 2026
dc2265e
ci(pre-commit): autofix
pre-commit-ci[bot] May 7, 2026
15bbf0e
remove unecessary changes
KSeangTan May 7, 2026
1323d4e
ci(pre-commit): autofix
pre-commit-ci[bot] May 7, 2026
585a0b2
remove unecessary changes
KSeangTan May 7, 2026
a47646e
ci(pre-commit): autofix
pre-commit-ci[bot] May 7, 2026
16eb517
Add the script
KSeangTan May 9, 2026
64c1698
Resolve conflict
KSeangTan May 9, 2026
731f6d9
Resolve conflict
KSeangTan May 9, 2026
ad4f746
Resolve conflict
KSeangTan May 9, 2026
be69b11
Resolve conflict
KSeangTan May 9, 2026
258e64c
Resolve conflict
KSeangTan May 9, 2026
75a46d3
Updated
KSeangTan May 9, 2026
16fe09b
Updated
KSeangTan May 9, 2026
db8e7f8
Updated
KSeangTan May 9, 2026
4c907aa
Updated
KSeangTan May 9, 2026
8cb422d
Updated
KSeangTan May 9, 2026
5635a00
Updated
KSeangTan May 9, 2026
fb27f49
Resolve conflict
KSeangTan May 11, 2026
bb5d757
Resolve conflict
KSeangTan May 12, 2026
3f64c2c
Resolve conflict
KSeangTan May 13, 2026
1a81b03
Add local 3d box expand
KSeangTan May 14, 2026
5257c01
Resolve conflict
KSeangTan May 14, 2026
6dde84d
Add local 3d box expand
KSeangTan May 16, 2026
5213d86
Add local 3d box expand
KSeangTan May 17, 2026
e616c02
Add local 3d box expand
KSeangTan May 18, 2026
b503655
Updated
KSeangTan May 15, 2026
6a9a475
Updated
KSeangTan May 18, 2026
f0f4542
Updated
KSeangTan May 19, 2026
c9c34bb
Add local 3d box expand
KSeangTan May 19, 2026
a8073f8
Add local 3d box expand
KSeangTan May 19, 2026
be70f2f
Add local 3d box expand
KSeangTan May 19, 2026
a5b4065
Add local 3d box expand
KSeangTan May 19, 2026
0b547bf
Add local 3d box expand
KSeangTan May 19, 2026
6949e41
Add local 3d box expand
KSeangTan May 19, 2026
bc6d024
Add local 3d box expand
KSeangTan May 19, 2026
81e26bb
Add local 3d box expand
KSeangTan May 20, 2026
770be09
Add local 3d box expand
KSeangTan May 20, 2026
89ab9c3
Updated
KSeangTan May 20, 2026
9594f3b
Updated
KSeangTan May 23, 2026
096f443
Updated
KSeangTan May 23, 2026
c6c79f8
Updated
KSeangTan May 23, 2026
1e639c7
Updated
KSeangTan May 23, 2026
03d9416
Updated
KSeangTan May 24, 2026
94e1752
Updated
KSeangTan May 24, 2026
36bfd4e
Updated
KSeangTan May 24, 2026
26e6bb0
Updated
KSeangTan May 25, 2026
b096792
Updated
KSeangTan May 25, 2026
0af40fc
Updated
KSeangTan May 25, 2026
f871a14
Updated
KSeangTan May 25, 2026
9a4642a
Updated
KSeangTan May 26, 2026
3cfe987
Updated
KSeangTan May 26, 2026
798021d
Updated
KSeangTan May 26, 2026
40f3ea9
Updated
KSeangTan May 29, 2026
7053c2d
Updated
KSeangTan May 29, 2026
c3d1e0b
Merge branch 'tier4:main' into main
KSeangTan Jun 5, 2026
316f8c7
Merge branch 'tier4:main' into main
KSeangTan Jun 5, 2026
9854527
Updated
KSeangTan Jun 7, 2026
d1fc710
Updated
KSeangTan Jun 7, 2026
9d949c6
Resolve conflicts
KSeangTan Jun 7, 2026
6f5dbeb
Updated
KSeangTan Jun 7, 2026
d19fd81
Merge branch 'tier4:main' into main
KSeangTan Jun 8, 2026
e9a2a16
Updated
KSeangTan Jun 11, 2026
d2aee28
Updated
KSeangTan Jun 12, 2026
f4fa2f0
Updated
KSeangTan Jun 13, 2026
0ef7842
Updated
KSeangTan Jun 13, 2026
b3595e0
Updated
KSeangTan Jun 13, 2026
e12a258
Updated
KSeangTan Jun 13, 2026
89eb99c
Merge branch 'tier4:main' into main
KSeangTan Jun 15, 2026
a9069d0
Merge branch 'main' into feat/release_bevfusion_2_8
Jun 15, 2026
0712c0a
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 15, 2026
d297c99
Added
Jun 15, 2026
9044bc0
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 15, 2026
247e1c9
Added
Jun 15, 2026
fffec2a
Added
KSeangTan Jun 17, 2026
e5f71ca
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 17, 2026
8c02f98
Added
KSeangTan Jun 17, 2026
bb19131
Added
KSeangTan Jun 18, 2026
b8a020d
Added
KSeangTan Jun 21, 2026
e07e7cd
Remove uncessary config changes
KSeangTan Jun 21, 2026
25c3852
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 21, 2026
c5a150c
Remove uncessary config changes
KSeangTan Jun 21, 2026
c1beda5
Remove uncessary config changes
KSeangTan Jun 21, 2026
5a0a731
Remove uncessary config changes
KSeangTan Jun 21, 2026
b3409e2
Remove uncessary config changes
KSeangTan Jun 21, 2026
4382008
Remove uncessary config changes
KSeangTan Jun 21, 2026
4a9ec6e
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 21, 2026
862e72b
Remove uncessary config changes
KSeangTan Jun 21, 2026
24c88eb
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 21, 2026
b0ae125
Remove uncessary config changes
KSeangTan Jun 21, 2026
8fad959
Remove uncessary config changes
KSeangTan Jun 21, 2026
450d60e
Merge branch 'main' into feat/release_bevfusion_2_8
KSeangTan Jun 21, 2026
685225b
Merge branch 'tier4:main' into main
KSeangTan Jun 21, 2026
0b12add
Merge branch 'main' into feat/release_bevfusion_2_8
KSeangTan Jun 21, 2026
179ca25
Remove uncessary config changes
KSeangTan Jun 22, 2026
0f47186
Update evaluation metrics
KSeangTan Jun 22, 2026
70fb27a
Update evaluation metrics
KSeangTan Jun 22, 2026
c75dd8e
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 22, 2026
f9e24ff
Update evaluation metrics
KSeangTan Jun 22, 2026
3d5e2fa
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 22, 2026
5f0d52b
Update evaluation metrics
KSeangTan Jun 22, 2026
6f001d1
Update base, j6gen2, jpntaxi docstring
KSeangTan Jun 22, 2026
00a0422
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 22, 2026
f0af174
Update base, j6gen2, jpntaxi docstring
KSeangTan Jun 22, 2026
15f2c99
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 22, 2026
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN python3 -m pip --no-cache-dir install \
RUN python3 -m pip install git+https://github.com/tier4/t4-devkit@v0.5.1

# Install autoware-perception-evaluation
RUN python3 -m pip install git+https://github.com/tier4/autoware_perception_evaluation@f67600293e3e74861f913da3efafd6bf436d2ab6
RUN python3 -m pip install git+https://github.com/tier4/autoware_perception_evaluation@85b78e52bca312911ea6730163dfeaa63c66c628

# Need to dowgrade setuptools to 60.2.0 to fix setup
RUN python3 -m pip --no-cache-dir install \
Expand Down
5 changes: 5 additions & 0 deletions autoware_ml/configs/detection3d/dataset/t4dataset/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"db_j6gen2_v7",
"db_j6gen2_v8",
"db_j6gen2_v9",
"db_j6gen2_v10",
"db_j6gen2_v11",
"db_j6gen2_v12",
"db_largebus_v1",
"db_largebus_v2",
"db_largebus_v3",
Expand Down Expand Up @@ -146,6 +149,8 @@
"traffic_cone": "traffic_cone",
"trafficcone": "traffic_cone",
"barrier": "barrier",
"other_vehicle": "car",
"other_pedestrian": "pedestrian",
}

class_names = ["car", "truck", "bus", "bicycle", "pedestrian", "traffic_cone", "barrier"]
Expand Down
5 changes: 5 additions & 0 deletions autoware_ml/configs/detection3d/dataset/t4dataset/j6gen2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"db_j6gen2_v7",
"db_j6gen2_v8",
"db_j6gen2_v9",
"db_j6gen2_v10",
"db_j6gen2_v11",
"db_j6gen2_v12",
]

dataset_test_groups = {
Expand Down Expand Up @@ -127,6 +130,8 @@
"traffic_cone": "traffic_cone",
"trafficcone": "traffic_cone",
"barrier": "barrier",
"other_vehicle": "car",
"other_pedestrian": "pedestrian",
}

class_names = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"db_j6gen2_v7",
"db_j6gen2_v8",
"db_j6gen2_v9",
"db_j6gen2_v10",
"db_j6gen2_v11",
"db_j6gen2_v12",
"db_largebus_v1",
"db_largebus_v2",
"db_largebus_v3",
Expand Down Expand Up @@ -133,6 +136,8 @@
"traffic_cone": "traffic_cone",
"trafficcone": "traffic_cone",
"barrier": "barrier",
"other_vehicle": "car",
"other_pedestrian": "pedestrian",
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
"traffic_cone": "traffic_cone",
"trafficcone": "traffic_cone",
"barrier": "barrier",
"other_vehicle": "car",
"other_pedestrian": "pedestrian",
}

class_names = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
"traffic_cone": "traffic_cone",
"trafficcone": "traffic_cone",
"barrier": "barrier",
"other_vehicle": "car",
"other_pedestrian": "pedestrian",
}

class_names = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@
"traffic_cone": "traffic_cone",
"trafficcone": "traffic_cone",
"barrier": "barrier",
"other_vehicle": "car",
"other_pedestrian": "pedestrian",
}

class_names = [
Expand Down
3 changes: 2 additions & 1 deletion autoware_ml/detection3d/datasets/transforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .local_3d_bbox import Local3DBBoxExpand
from .object_min_points_filter import ObjectMinPointsFilter

__all__ = ["ObjectMinPointsFilter"]
__all__ = ["ObjectMinPointsFilter", "Local3DBBoxExpand"]
58 changes: 58 additions & 0 deletions autoware_ml/detection3d/datasets/transforms/local_3d_bbox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from typing import List

import numpy as np
from mmcv.transforms import BaseTransform
from mmdet3d.structures.ops import box_np_ops
from mmengine.registry import TRANSFORMS


@TRANSFORMS.register_module()
class Local3DBBoxExpand(BaseTransform):
"""Locally expand the 3D bounding boxes by scaling the width, which it doesn't scale the points.

Args:
expand_widths: (List[float]): Uniformly sampled expand width.
width_dim: (int): The dimension of the width. Default is 4, which is the width dimension of the 3D
bounding box. Since 3D Bbox is in the format of [x, y, z, dx, dy, dz, heading], the width dimension is the
4th dimension.
label_ids: (List[int]): The label IDs to expand. If None, all label IDs will be expanded.
"""

def __init__(self, expand_widths: List[float], width_dim: int = 4, label_ids: List[int] = None) -> None:
assert isinstance(expand_widths, list)
assert len(expand_widths) == 2
assert expand_widths[0] < expand_widths[1]
self.expand_widths = expand_widths
self.width_dim = width_dim
self.label_ids = label_ids

def transform(self, input_dict: dict) -> dict:
"""Call function to locally augment the 3D bounding boxes by scaling the width.

Args:
input_dict (dict): Result dict from loading pipeline.

Returns:
dict: Results after locally augmenting the 3D bounding boxes by scaling the width, 'gt_bboxes_3d' \
key is updated in the result dict.
"""
# Label mask
if self.label_ids is not None:
label_masks = [True if label in self.label_ids else False for label in input_dict["gt_labels_3d"]]
else:
label_masks = np.ones(len(input_dict["gt_labels_3d"]), dtype=bool)

for i in range(len(input_dict["gt_bboxes_3d"])):
if not label_masks[i]:
continue

expand_width = np.random.uniform(self.expand_widths[0], self.expand_widths[1])
input_dict["gt_bboxes_3d"].tensor[i, self.width_dim] += expand_width

return input_dict

def __repr__(self) -> str:
"""str: Return a string that describes the module."""
repr_str = self.__class__.__name__
repr_str += f"(expand_widths={self.expand_widths}, width_dim={self.width_dim}, label_ids={self.label_ids})"
return repr_str
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def transform(self, input_dict: dict) -> dict:
indices = box_np_ops.points_in_rbbox(
points.tensor.numpy()[:, :3],
gt_bboxes_3d.tensor.numpy()[:, :7],
origin=(0.5, 0.5, 0.0), # Always assume it's center_x, center_y and bottom_z
)
num_points_in_gt = indices.sum(0)
gt_bboxes_mask = num_points_in_gt >= self.min_num_points
Expand Down Expand Up @@ -107,6 +108,7 @@ def transform(self, input_dict: dict) -> dict:
indices = box_np_ops.points_in_rbbox(
points.tensor.numpy()[:, :3],
gt_bboxes_3d.tensor.numpy()[:, :7],
origin=(0.5, 0.5, 0.0), # Always assume it's center_x, center_y and bottom_z
)

num_points_in_gt = indices.sum(0)
Expand Down
108 changes: 103 additions & 5 deletions autoware_ml/detection3d/evaluation/t4metric/t4metric_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import torch
from mmdet3d.registry import METRICS
from mmdet3d.structures import LiDARInstance3DBoxes
from mmdet3d.structures.ops import box_np_ops
from mmengine.dist import get_world_size
from mmengine.evaluator import BaseMetric
from mmengine.logging import MessageHub, MMLogger
Expand Down Expand Up @@ -243,6 +244,7 @@ def __init__(
experiment_name: str,
experiment_group_name: str,
write_metric_summary: bool,
min_num_points: int = 0,
evaluate_frame_prefix: bool = True,
checkpoint_path: Optional[Union[Path, str]] = None,
scene_batch_size: int = 128,
Expand All @@ -268,6 +270,7 @@ def __init__(
self.experiment_name = experiment_name
self.experiment_group_name = experiment_group_name
self.name_mapping = name_mapping
self.min_num_points = min_num_points
if name_mapping is not None:
self.class_names = [self.name_mapping.get(name, name) for name in self.class_names]

Expand Down Expand Up @@ -435,10 +438,11 @@ def process(self, data_batch: dict, data_samples: Sequence[dict]) -> None:
# Skip processing if result pickle already exists
return

for data_sample in data_samples:
batch_points = data_batch["inputs"]["points"]
for data_sample, points in zip(data_samples, batch_points):
current_time = data_sample["timestamp"]
scene_id = self._parse_scene_id(data_sample["lidar_path"])
frame_ground_truth = self._parse_ground_truth_from_sample(current_time, data_sample)
frame_ground_truth = self._parse_ground_truth_from_sample(current_time, data_sample, points)
perception_frame = self._parse_predictions_from_sample(current_time, data_sample, frame_ground_truth)
self._save_perception_frame(scene_id, data_sample["sample_idx"], perception_frame)

Expand Down Expand Up @@ -985,11 +989,27 @@ def _aggregate_metrics_data(

# Create precision_interpolate and recall_interpolate keys
iterable_metrics[
f"T4MetricV2_label_detection/{label_name}_precisions_{matching_mode}_{threshold}"
f"T4MetricV2_label_detection/{label_name}_interp-precisions_{matching_mode}_{threshold}"
] = ap.precision_interp.tolist()
iterable_metrics[
f"T4MetricV2_label_detection/{label_name}_recalls_{matching_mode}_{threshold}"
f"T4MetricV2_label_detection/{label_name}_interp-recalls_{matching_mode}_{threshold}"
] = ap.recall_interp.tolist()
iterable_metrics[
f"T4MetricV2_label_detection/{label_name}_interp-confs_{matching_mode}_{threshold}"
] = ap.conf_interp.tolist()

# TP error metrics (e.g. ATE, AOE, ASE, AVE, AAE)
if ap.tp_error_metrics is not None:
for tp_error_metric in ap.tp_error_metrics:
mode = tp_error_metric.mode
average_mode = tp_error_metric.average_mode

iterable_metrics[
f"T4MetricV2_label_detection/{label_name}_{mode}_values_{matching_mode}_{threshold}"
] = tp_error_metric.values.tolist()
iterable_metrics[
f"T4MetricV2_label_detection/{label_name}_{mode}_interp-values_{matching_mode}_{threshold}"
] = tp_error_metric.interpolated_values.tolist()

return iterable_metrics

Expand Down Expand Up @@ -1044,6 +1064,40 @@ def _process_metrics_for_aggregation(self, metrics_score: MetricsScore, evaluato
ap.optimal_precision
)

# Number of prediction matches (TPs) and matches at the optimal confidence threshold
metric_dict[f"T4MetricV2_label/{label_name}_num-match_{matching_mode}_{threshold}"] = ap.num_tp
metric_dict[f"T4MetricV2_label/{label_name}_min-recall-num-match_{matching_mode}_{threshold}"] = (
ap.num_tp_at_min_recall_conf
)
metric_dict[
f"T4MetricV2_label/{label_name}_medium-recall-num-match_{matching_mode}_{threshold}"
] = ap.num_tp_at_medium_recall_conf
metric_dict[f"T4MetricV2_label/{label_name}_optimal-num-match_{matching_mode}_{threshold}"] = (
ap.num_tp_at_optimal_conf
)

# TP error metrics (e.g. ATE, AOE, ASE, AVE, AAE)
if ap.tp_error_metrics is not None:
for tp_error_metric in ap.tp_error_metrics:
mode = tp_error_metric.mode
average_mode = tp_error_metric.average_mode

metric_dict[
f"T4MetricV2_label/{label_name}_tp-error_{average_mode}_{matching_mode}_{threshold}"
] = tp_error_metric.avg_metric
metric_dict[
f"T4MetricV2_label/{label_name}_tp-error-min-recall-conf_{average_mode}_{matching_mode}_{threshold}"
] = tp_error_metric.min_recall_conf
metric_dict[
f"T4MetricV2_label/{label_name}_tp-error-optimal-{average_mode}_{matching_mode}_{threshold}"
] = tp_error_metric.optimal_avg_metric
metric_dict[
f"T4MetricV2_label/{label_name}_tp-error-medium-{average_mode}_{matching_mode}_{threshold}"
] = tp_error_metric.medium_avg_metric
metric_dict[
f"T4MetricV2_label/{label_name}_tp-error-medium-recall-conf-{average_mode}_{matching_mode}_{threshold}"
] = tp_error_metric.medium_recall_conf

# Label metadata key
metric_dict[f"metadata_label/test_{label_name}_num_predictions"] = label_num_preds
metric_dict[f"metadata_label/test_{label_name}_num_ground_truths"] = label_num_gts
Expand All @@ -1054,6 +1108,41 @@ def _process_metrics_for_aggregation(self, metrics_score: MetricsScore, evaluato
metric_dict[map_key] = map_instance.map
metric_dict[maph_key] = map_instance.maph

# Add mean TP errors (e.g. mATE, mAOE, mASE, mAVE, mAAE)
if map_instance.mean_tp_errors is not None:
for mean_tp_error_name, mean_tp_error_value in map_instance.mean_tp_errors.items():
metric_dict[f"T4MetricV2/mean-tp-error_{mean_tp_error_name}_{matching_mode}"] = mean_tp_error_value

optimal_mean_tp_errors = map_instance.optimal_mean_tp_errors.get(mean_tp_error_name, None)
if optimal_mean_tp_errors is not None:
metric_dict[f"T4MetricV2/mean-tp-error-optimal-{mean_tp_error_name}_{matching_mode}"] = (
optimal_mean_tp_errors
)

medium_mean_tp_errors = map_instance.medium_mean_tp_errors.get(mean_tp_error_name, None)
if medium_mean_tp_errors is not None:
metric_dict[f"T4MetricV2/mean-tp-error-medium-{mean_tp_error_name}_{matching_mode}"] = (
medium_mean_tp_errors
)

# Add NuScenes Detection Score (NDS) based on mAP and mAPH
if map_instance.map_based_nds is not None:
metric_dict[f"T4MetricV2/{map_instance.map_based_nds.metric_prefix_name}_nds_{matching_mode}"] = (
map_instance.map_based_nds.nds
)
if map_instance.medium_map_based_nds is not None:
metric_dict[
f"T4MetricV2/{map_instance.medium_map_based_nds.metric_prefix_name}_nds_{matching_mode}"
] = map_instance.medium_map_based_nds.nds
if map_instance.mapH_based_nds is not None:
metric_dict[f"T4MetricV2/{map_instance.mapH_based_nds.metric_prefix_name}_nds_{matching_mode}"] = (
map_instance.mapH_based_nds.nds
)
if map_instance.medium_mapH_based_nds is not None:
metric_dict[
f"T4MetricV2/{map_instance.medium_mapH_based_nds.metric_prefix_name}_nds_{matching_mode}"
] = map_instance.medium_mapH_based_nds.nds

total_num_preds = num_preds

# Selected evaluator
Expand Down Expand Up @@ -1295,7 +1384,7 @@ def _parse_scene_id(self, lidar_path: str) -> str:
except ValueError:
return _UNKNOWN

def _parse_ground_truth_from_sample(self, time: float, data_sample: Dict[str, Any]) -> FrameGroundTruth:
def _parse_ground_truth_from_sample(self, time: float, data_sample: Dict[str, Any], points) -> FrameGroundTruth:
"""Parses ground truth objects from the given data sample.

Args:
Expand Down Expand Up @@ -1325,6 +1414,15 @@ def _parse_ground_truth_from_sample(self, time: float, data_sample: Dict[str, An
# num_lidar_pts: (N,) array of int, number of LiDAR points inside each GT box
num_lidar_pts: np.ndarray = eval_info.get("num_lidar_pts", np.array([]))

if self.min_num_points > 0 and len(bboxes):
points_cpu = points.cpu().numpy()
indices = box_np_ops.points_in_rbbox(points_cpu[:, :3], bboxes[:, :7])
num_points_in_gt = indices.sum(0)
bboxes_mask = num_points_in_gt >= self.min_num_points
bboxes = bboxes[bboxes_mask]
gt_labels_3d = gt_labels_3d[bboxes_mask]
num_lidar_pts = num_lidar_pts[bboxes_mask]

dynamic_objects = [
DynamicObject(
unix_time=time,
Expand Down
2 changes: 2 additions & 0 deletions projects/BEVFusion/bevfusion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .bevfusion import BEVFusion
from .bevfusion_head import BEVFusionHead, ConvFuser
from .bevfusion_necks import GeneralizedLSSFPN
from .bevfusion_voxel_encoder import HardSimpleVoxelSinCosEncoder
from .depth_lss import DepthLSSTransform, LSSTransform
from .loading import BEVLoadMultiViewImageFromFiles
from .sparse_encoder import BEVFusionSparseEncoder
Expand All @@ -27,4 +28,5 @@
"BEVFusionRandomFlip3D",
"BEVFusionGlobalRotScaleTrans",
"TransFusionBBoxCoder",
"HardSimpleVoxelSinCosEncoder",
]
Loading