From 058fafd2a46da54d61f9b80cd7a164504bd62939 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Fri, 27 May 2022 21:42:09 +0800 Subject: [PATCH] fix mosaic in voc dataset (#6021) * fix mosaic in voc dataset * fix is_crowd --- ppdet/data/transform/operators.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index 87dc27546..052e35101 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -3217,9 +3217,11 @@ class Mosaic(BaseOperator): _gt_bbox[:, 2] = scale * gt_bbox[:, 2] + padw _gt_bbox[:, 3] = scale * gt_bbox[:, 3] + padh + is_crowd = sp['is_crowd'] if 'is_crowd' in sp else np.zeros( + (len(_gt_bbox), 1), dtype=np.int32) mosaic_gt_bbox.append(_gt_bbox) mosaic_gt_class.append(sp['gt_class']) - mosaic_is_crowd.append(sp['is_crowd']) + mosaic_is_crowd.append(is_crowd) # 2. clip bbox and get mosaic_labels([gt_bbox, gt_class, is_crowd]) if len(mosaic_gt_bbox): -- GitLab