From d0a3c56543556baad67ee9a3458a7bb8f240517d Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Mon, 14 Sep 2020 20:10:13 +0800 Subject: [PATCH] fix ImageMixup with no gt_bbox. (#1404) --- ppdet/data/transform/operators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index f1f8b1f70..b49111933 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -1266,8 +1266,8 @@ class MixupImage(BaseOperator): if factor <= 0.0: return sample['mixup'] im = self._mixup_img(sample['image'], sample['mixup']['image'], factor) - gt_bbox1 = sample['gt_bbox'] - gt_bbox2 = sample['mixup']['gt_bbox'] + gt_bbox1 = sample['gt_bbox'].reshape((-1, 4)) + gt_bbox2 = sample['mixup']['gt_bbox'].reshape((-1, 4)) gt_bbox = np.concatenate((gt_bbox1, gt_bbox2), axis=0) gt_class1 = sample['gt_class'] gt_class2 = sample['mixup']['gt_class'] -- GitLab