浏览代码

fix np.delete bug

will-jl944 4 年之前
父节点
当前提交
ca099e8e93
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      paddlex/cv/datasets/coco.py

+ 3 - 3
paddlex/cv/datasets/coco.py

@@ -145,9 +145,9 @@ class CocoDetection(VOCDetection):
                     if not np.array(box[
                     if not np.array(box[
                             'segmentation']).size > 0 and not self.allow_empty:
                             'segmentation']).size > 0 and not self.allow_empty:
                         gt_poly.pop(i)
                         gt_poly.pop(i)
-                        np.delete(is_crowd, i)
-                        np.delete(gt_class, i)
-                        np.delete(gt_bbox, i)
+                        is_crowd = np.delete(is_crowd, i)
+                        gt_class = np.delete(gt_class, i)
+                        gt_bbox = np.delete(gt_bbox, i)
                     else:
                     else:
                         gt_poly[i] = box['segmentation']
                         gt_poly[i] = box['segmentation']
                     has_segmentation = True
                     has_segmentation = True