diff --git a/ppdet/data/source/coco.py b/ppdet/data/source/coco.py index 6578de183a9e4b72a3682bf9818ab5e9ed7fff15..e87e9bf703df485800d3d442086eaed1114ccc98 100644 --- a/ppdet/data/source/coco.py +++ b/ppdet/data/source/coco.py @@ -188,8 +188,9 @@ class COCODataSet(DetDataset): if 'segmentation' in box and box['iscrowd'] == 1: gt_poly[i] = [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]] elif 'segmentation' in box and box['segmentation']: - if not np.array(box['segmentation'] - ).size > 0 and not self.allow_empty: + if not np.array( + box['segmentation'], + dtype=object).size > 0 and not self.allow_empty: bboxes.pop(i) gt_poly.pop(i) np.delete(is_crowd, i)