From 5f1278482b1ff39c1a9428ec85fa5f0e60a32305 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Thu, 28 Feb 2019 20:08:58 -0500 Subject: [PATCH] Fixed missing annotations, closes #127 --- app/util/coco_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/util/coco_util.py b/app/util/coco_util.py index 6d6249aa..0c3d4d3b 100644 --- a/app/util/coco_util.py +++ b/app/util/coco_util.py @@ -208,7 +208,7 @@ def get_dataset_coco(dataset): has_keypoints = len(annotation.get('keypoints', [])) > 0 has_segmentation = len(annotation.get('segmentation', [])) > 0 - if has_keypoints or has_keypoints: + if has_keypoints or has_segmentation: del annotation['deleted'] if not has_keypoints: @@ -217,6 +217,7 @@ def get_dataset_coco(dataset): arr = np.array(annotation.get('keypoints', [])) arr = arr[2::3] annotation['num_keypoints'] = len(arr[arr > 0]) + coco.get('annotations').append(annotation) image = fix_ids(image)