From 7c0abad45357265c303dfcbacfadf173e7893832 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Wed, 13 Jan 2021 09:46:11 +0800 Subject: [PATCH] fix condition of coco segmention (#2048) --- dygraph/ppdet/data/source/coco.py | 2 +- ppdet/data/source/coco.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dygraph/ppdet/data/source/coco.py b/dygraph/ppdet/data/source/coco.py index e631cfa9f..aacaa771c 100644 --- a/dygraph/ppdet/data/source/coco.py +++ b/dygraph/ppdet/data/source/coco.py @@ -128,7 +128,7 @@ class COCODataSet(DetDataset): # check RLE format if 'segmentation' in box and box['iscrowd'] == 1: gt_poly[i] = [[0.0, 0.0], ] - elif 'segmentation' in box: + elif 'segmentation' in box and box['segmentation']: gt_poly[i] = box['segmentation'] has_segmentation = True diff --git a/ppdet/data/source/coco.py b/ppdet/data/source/coco.py index 388f207d7..4c25875b3 100644 --- a/ppdet/data/source/coco.py +++ b/ppdet/data/source/coco.py @@ -162,7 +162,7 @@ class COCODataSet(DataSet): gt_class[i][0] = catid2clsid[catid] gt_bbox[i, :] = box['clean_bbox'] is_crowd[i][0] = box['iscrowd'] - if 'segmentation' in box: + if 'segmentation' in box and box['segmentation']: gt_poly[i] = box['segmentation'] has_segmentation = True -- GitLab