From 6da3131077dfee95cdac23c07696d2c7e63033c2 Mon Sep 17 00:00:00 2001 From: Zebing Bai Date: Tue, 2 Mar 2021 16:57:27 +0800 Subject: [PATCH] Show bbox even if no segs or keypts Draw bounding box on the pics even if there is no setmentations or keypoints Signed-off-by: Zebing Bai --- PythonAPI/pycocotools/coco.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PythonAPI/pycocotools/coco.py b/PythonAPI/pycocotools/coco.py index e4182c74..d39f8583 100644 --- a/PythonAPI/pycocotools/coco.py +++ b/PythonAPI/pycocotools/coco.py @@ -238,7 +238,7 @@ def showAnns(self, anns, draw_bbox=False): """ if len(anns) == 0: return 0 - if 'segmentation' in anns[0] or 'keypoints' in anns[0]: + if 'segmentation' in anns[0] or 'keypoints' in anns[0] or 'bbox' in anns[0]: datasetType = 'instances' elif 'caption' in anns[0]: datasetType = 'captions' @@ -438,4 +438,4 @@ def annToMask(self, ann): """ rle = self.annToRLE(ann) m = maskUtils.decode(rle) - return m \ No newline at end of file + return m