From b6cd99eb82caa49e9d9c124af069fdc59e0830cf Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Fri, 11 Dec 2020 10:51:12 +0800 Subject: [PATCH] fix condition when segm is empty (#1864) --- ppdet/data/reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ppdet/data/reader.py b/ppdet/data/reader.py index cb5549892..d19653078 100644 --- a/ppdet/data/reader.py +++ b/ppdet/data/reader.py @@ -346,7 +346,8 @@ class Reader(object): # 'drop this sample'.format( # sample['im_file'], sample['gt_bbox'])) continue - if self._drop_empty and self._fields and 'gt_poly' in sample: + has_mask = 'gt_mask' in self._fields or 'gt_segm' in self._fields + if self._drop_empty and self._fields and has_mask: if _has_empty(_segm(sample)): #logger.warn('gt_mask is empty or not valid in {}'.format( # sample['im_file'])) -- GitLab