From a2ae4748459b697ddbb7f3529df245549562f0d4 Mon Sep 17 00:00:00 2001 From: Danila Rukhovich Date: Sun, 24 Apr 2022 19:56:33 +0400 Subject: [PATCH] add else case --- mmdet3d/models/dense_heads/point_rpn_head.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mmdet3d/models/dense_heads/point_rpn_head.py b/mmdet3d/models/dense_heads/point_rpn_head.py index 71df2389e8..5561ce52db 100644 --- a/mmdet3d/models/dense_heads/point_rpn_head.py +++ b/mmdet3d/models/dense_heads/point_rpn_head.py @@ -343,6 +343,11 @@ def class_agnostic_nms(self, obj_scores, sem_scores, bbox, points, score_selected = obj_scores_nms[keep] cls_preds = sem_scores_nms[keep] labels = torch.argmax(cls_preds, -1) + else: + bbox_selected = bbox.tensor + score_selected = obj_scores.new_zeros([0]) + labels = obj_scores.new_zeros([0]) + cls_preds = obj_scores.new_zeros([0, sem_scores.shape[-1]]) return bbox_selected, score_selected, labels, cls_preds