From 378295c1e863c804e05889d18478478d3fca2c11 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Fri, 11 Dec 2020 13:31:27 +0800 Subject: [PATCH] fix condition when segm is empty (#1865) Co-authored-by: Guanghua Yu <742925032@qq.com> --- 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