From b98f372eb45ed044573eef281acf041ed763660b Mon Sep 17 00:00:00 2001 From: ilcopione <109541948+ilcopione@users.noreply.github.com> Date: Wed, 27 Dec 2023 02:47:02 +0100 Subject: [PATCH] Fixed mask shape after Albu postprocess (#11280) --- mmdet/datasets/transforms/transforms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mmdet/datasets/transforms/transforms.py b/mmdet/datasets/transforms/transforms.py index 4ac2bf75b54..c50b987db33 100644 --- a/mmdet/datasets/transforms/transforms.py +++ b/mmdet/datasets/transforms/transforms.py @@ -1766,8 +1766,10 @@ def _postprocess_results( results['masks'] = np.array( [results['masks'][i] for i in results['idx_mapper']]) results['masks'] = ori_masks.__class__( - results['masks'], ori_masks.height, ori_masks.width) - + results['masks'], + results['masks'][0].shape[0], + results['masks'][0].shape[1], + ) if (not len(results['idx_mapper']) and self.skip_img_without_anno): return None