diff --git a/ppdet/data/reader.py b/ppdet/data/reader.py index cb5549892b94ce101cc1b78d5a9f422d5822446d..d19653078fa20cfd01ccf1f7c9dc670008c0b312 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']))