From 4497f183bf83362127a886ae522f4008ac4f4373 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Thu, 22 Dec 2022 11:55:13 +0800 Subject: [PATCH] support numpy 1.24 (#7539) --- ppdet/data/source/coco.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppdet/data/source/coco.py b/ppdet/data/source/coco.py index 6578de183..e87e9bf70 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) -- GitLab