未验证 提交 eb6d1196 编写于 作者: W wangguanzhong 提交者: GitHub

enhance data check (#1635)

上级 3b8aea16
...@@ -137,12 +137,14 @@ class COCODataSet(DataSet): ...@@ -137,12 +137,14 @@ class COCODataSet(DataSet):
y1 = max(0, y) y1 = max(0, y)
x2 = min(im_w - 1, x1 + max(0, box_w - 1)) x2 = min(im_w - 1, x1 + max(0, box_w - 1))
y2 = min(im_h - 1, y1 + max(0, box_h - 1)) y2 = min(im_h - 1, y1 + max(0, box_h - 1))
if 'segmentation' in inst and len(inst[ if 'segmentation' in inst:
'segmentation']) == 0: if inst['segmentation'] is None or len(inst[
logger.warn( 'segmentation']) == 0:
'Found an empty segmentation in annotations: im_id: {}.'. logger.warn(
format(img_id)) 'Found an empty segmentation in annotations: im_id: {}.'.
elif x2 >= x1 and y2 >= y1: format(img_id))
continue
if x2 >= x1 and y2 >= y1:
inst['clean_bbox'] = [x1, y1, x2, y2] inst['clean_bbox'] = [x1, y1, x2, y2]
bboxes.append(inst) bboxes.append(inst)
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册