提交 e9672b57 编写于 作者: S sunxl1988

test=dygraph fix coco

上级 9ba7b898
...@@ -82,6 +82,12 @@ class COCODataset(DetDataset): ...@@ -82,6 +82,12 @@ class COCODataset(DetDataset):
bboxes = [] bboxes = []
for inst in instances: for inst in instances:
# check gt bbox
if 'bbox' not in inst.keys():
continue
else:
if not any(np.array(inst['bbox'])):
continue
x, y, box_w, box_h = inst['bbox'] x, y, box_w, box_h = inst['bbox']
x1 = max(0, x) x1 = max(0, x)
y1 = max(0, y) y1 = max(0, y)
...@@ -109,9 +115,16 @@ class COCODataset(DetDataset): ...@@ -109,9 +115,16 @@ class COCODataset(DetDataset):
gt_class[i][0] = catid2clsid[catid] gt_class[i][0] = catid2clsid[catid]
gt_bbox[i, :] = box['clean_bbox'] gt_bbox[i, :] = box['clean_bbox']
is_crowd[i][0] = box['iscrowd'] is_crowd[i][0] = box['iscrowd']
# check RLE format
if box['iscrowd'] == 1:
gt_poly[i] = [[0.0, 0.0], ]
continue
if 'segmentation' in box: if 'segmentation' in box:
gt_poly[i] = box['segmentation'] gt_poly[i] = box['segmentation']
if not any(gt_poly):
continue
coco_rec.update({ coco_rec.update({
'is_crowd': is_crowd, 'is_crowd': is_crowd,
'gt_class': gt_class, 'gt_class': gt_class,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册