From 487c5104c1e1b70aae9274bee0282e98009ce0b4 Mon Sep 17 00:00:00 2001 From: Duo Li Date: Tue, 29 Aug 2023 10:41:25 +0800 Subject: [PATCH 1/2] QIM does not apply to the last frame --- projects/mmdet3d_plugin/uniad/detectors/uniad_track.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/mmdet3d_plugin/uniad/detectors/uniad_track.py b/projects/mmdet3d_plugin/uniad/detectors/uniad_track.py index 577ae38..3a2c18b 100644 --- a/projects/mmdet3d_plugin/uniad/detectors/uniad_track.py +++ b/projects/mmdet3d_plugin/uniad/detectors/uniad_track.py @@ -371,6 +371,7 @@ def _forward_single_frame_train( all_matched_indices=None, all_instances_pred_logits=None, all_instances_pred_boxes=None, + is_last=False, ): """ Perform forward only on one frame. Called in forward_train @@ -470,8 +471,11 @@ def _forward_single_frame_train( tmp = {} tmp["init_track_instances"] = self._generate_empty_tracks() tmp["track_instances"] = track_instances - out_track_instances = self.query_interact(tmp) - out["track_instances"] = out_track_instances + if is_last: + out["track_instances"] = None + else: + out_track_instances = self.query_interact(tmp) + out["track_instances"] = out_track_instances return out def select_active_track_query(self, track_instances, active_index, img_metas, with_mask=True): @@ -567,6 +571,7 @@ def forward_track_train(self, all_matched_idxes, all_instances_pred_logits, all_instances_pred_boxes, + is_last=(i==num_frame-1), ) # all_query_embeddings: len=dec nums, N*256 # all_matched_idxes: len=dec nums, N*2 From cfa3d3d75a475a488052d7459814a88697d97022 Mon Sep 17 00:00:00 2001 From: Duo Li Date: Tue, 29 Aug 2023 10:42:38 +0800 Subject: [PATCH 2/2] fix can bus info of the first frame --- projects/mmdet3d_plugin/uniad/detectors/uniad_e2e.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/mmdet3d_plugin/uniad/detectors/uniad_e2e.py b/projects/mmdet3d_plugin/uniad/detectors/uniad_e2e.py index 78a4a87..20ea32c 100644 --- a/projects/mmdet3d_plugin/uniad/detectors/uniad_e2e.py +++ b/projects/mmdet3d_plugin/uniad/detectors/uniad_e2e.py @@ -274,7 +274,7 @@ def forward_test(self, tmp_pos = copy.deepcopy(img_metas[0][0]['can_bus'][:3]) tmp_angle = copy.deepcopy(img_metas[0][0]['can_bus'][-1]) # first frame - if self.prev_frame_info['scene_token'] is None: + if self.prev_frame_info['prev_bev'] is None: img_metas[0][0]['can_bus'][:3] = 0 img_metas[0][0]['can_bus'][-1] = 0 # following frames