From 9a58729b242c415705e5675db74324232379221a Mon Sep 17 00:00:00 2001 From: Daa98 <45008718+Daa98@users.noreply.github.com> Date: Tue, 11 Oct 2022 20:00:55 +0800 Subject: [PATCH 1/2] Update loading.py RLE counts is str type --- mmdet/datasets/transforms/loading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmdet/datasets/transforms/loading.py b/mmdet/datasets/transforms/loading.py index 03dd5839bc2..7ad3b30a157 100644 --- a/mmdet/datasets/transforms/loading.py +++ b/mmdet/datasets/transforms/loading.py @@ -347,7 +347,7 @@ def _process_masks(self, results: dict) -> list: elif isinstance(gt_mask, dict) and \ not (gt_mask.get('counts') is not None and gt_mask.get('size') is not None and - isinstance(gt_mask['counts'], list)): + isinstance(gt_mask['counts'], str)): # if gt_mask is a dict, it should include `counts` and `size`, # so that `BitmapMasks` can uncompressed RLE instance['ignore_flag'] = 1 From 6096354c6b36f64860ba46fecb55000d7e14b9fe Mon Sep 17 00:00:00 2001 From: Daa98 <45008718+Daa98@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:16:40 +0800 Subject: [PATCH 2/2] Update loading.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As reminded by @BIGWangYuDong, counts in COCO’s compressed RLE format have type 'str' or 'list' --- mmdet/datasets/transforms/loading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmdet/datasets/transforms/loading.py b/mmdet/datasets/transforms/loading.py index 7ad3b30a157..1e35a05b6f6 100644 --- a/mmdet/datasets/transforms/loading.py +++ b/mmdet/datasets/transforms/loading.py @@ -347,7 +347,7 @@ def _process_masks(self, results: dict) -> list: elif isinstance(gt_mask, dict) and \ not (gt_mask.get('counts') is not None and gt_mask.get('size') is not None and - isinstance(gt_mask['counts'], str)): + isinstance(gt_mask['counts'], (list, str))): # if gt_mask is a dict, it should include `counts` and `size`, # so that `BitmapMasks` can uncompressed RLE instance['ignore_flag'] = 1