From 8dfbd86a4e0cb8a9892b9a25994a04491416d154 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Tue, 12 Jan 2021 22:29:59 +0800 Subject: [PATCH] fix condition of coco segmention (#2046) --- 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