未验证 提交 a8670536 编写于 作者: G Guanghua Yu 提交者: GitHub

fix has_empty condition in Reader (#1281)

上级 29a91f30
......@@ -338,17 +338,17 @@ class Reader(object):
sample["curr_iter"] = self._curr_iter
self._pos += 1
if self._drop_empty and self._fields and 'gt_mask' in self._fields:
if _has_empty(_segm(sample)):
#logger.warn('gt_mask is empty or not valid in {}'.format(
# sample['im_file']))
continue
if self._drop_empty and self._fields and 'gt_bbox' in self._fields:
if self._drop_empty and self._fields and 'gt_bbox' in sample:
if _has_empty(sample['gt_bbox']):
#logger.warn('gt_bbox {} is empty or not valid in {}, '
# 'drop this sample'.format(
# sample['im_file'], sample['gt_bbox']))
continue
if self._drop_empty and self._fields and 'gt_poly' in sample:
if _has_empty(_segm(sample)):
#logger.warn('gt_mask is empty or not valid in {}'.format(
# sample['im_file']))
continue
if self._load_img:
sample['image'] = self._load_image(sample['im_file'])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册