From 17f8abced8e05a667dbca29af0c644f343c22e71 Mon Sep 17 00:00:00 2001 From: Yue Zhou <592267829@qq.com> Date: Mon, 27 Mar 2023 16:26:34 +0800 Subject: [PATCH] Fix bug when training images without gt (#786) --- mmrotate/structures/bbox/bbox_overlaps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmrotate/structures/bbox/bbox_overlaps.py b/mmrotate/structures/bbox/bbox_overlaps.py index af4fe9e8e..19fda962f 100644 --- a/mmrotate/structures/bbox/bbox_overlaps.py +++ b/mmrotate/structures/bbox/bbox_overlaps.py @@ -82,7 +82,8 @@ def fake_rbbox_overlaps(bboxes1: RotatedBoxes, assert rows == cols if rows * cols == 0: - return bboxes1.new(rows, 1) if is_aligned else bboxes1.new(rows, cols) + return bboxes1.tensor.new( + rows, 1) if is_aligned else bboxes1.tensor.new(rows, cols) # convert rbb to minimum circumscribed hbb in format. fake_rbboxes1 = bboxes1.convert_to('hbox').convert_to('rbox')