From 0058832e750777d1d8a80bad80fe68692f07f26c Mon Sep 17 00:00:00 2001 From: linxuewu <50012935+linxuewu@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:56:50 +0800 Subject: [PATCH] fix bug in anchor_projection --- .../mmdet3d_plugin/models/detection3d/detection3d_blocks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/mmdet3d_plugin/models/detection3d/detection3d_blocks.py b/projects/mmdet3d_plugin/models/detection3d/detection3d_blocks.py index 60ea961..0e17087 100644 --- a/projects/mmdet3d_plugin/models/detection3d/detection3d_blocks.py +++ b/projects/mmdet3d_plugin/models/detection3d/detection3d_blocks.py @@ -291,6 +291,10 @@ def anchor_projection( T_src2dst[..., :vel_dim, :vel_dim], vel[..., None] ).squeeze(-1) dst_anchor = torch.cat([center, size, yaw, vel], dim=-1) + index = [X, Y, Z, W, L, H, COS_YAW, SIN_YAW] + [VX, VY, VZ][:vel_dim] + index = torch.tensor(index, device=dst_anchor.device) + index = torch.argsort(index) + dst_anchor = dst_anchor.index_select(dim=-1, index=index) dst_anchors.append(dst_anchor) return dst_anchors