From e913541fffe2f6d1a4fb86c7100631b08f8f283f Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Thu, 9 Apr 2020 18:01:18 +0300 Subject: [PATCH 1/3] Reporoduce the problem #1387 --- datumaro/tests/test_coco_format.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datumaro/tests/test_coco_format.py b/datumaro/tests/test_coco_format.py index f9340b659e8b..a0339abc7389 100644 --- a/datumaro/tests/test_coco_format.py +++ b/datumaro/tests/test_coco_format.py @@ -560,6 +560,9 @@ def __iter__(self): annotations=[ # Solitary keypoints Points([1, 2, 0, 2, 4, 1], label=5, id=3), + + # Some other solitary annotations (bug #1387) + Polygon([0, 0, 4, 0, 4, 4], label=3, id=4), ]), DatasetItem(id=3, subset='val', From 0de4ad51305000d69a2d42460fc094326d5fffc5 Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Thu, 9 Apr 2020 18:08:00 +0300 Subject: [PATCH 2/3] fix --- datumaro/datumaro/plugins/coco_format/converter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datumaro/datumaro/plugins/coco_format/converter.py b/datumaro/datumaro/plugins/coco_format/converter.py index b5766d046c29..fe5806af1ec1 100644 --- a/datumaro/datumaro/plugins/coco_format/converter.py +++ b/datumaro/datumaro/plugins/coco_format/converter.py @@ -364,9 +364,9 @@ def find_solitary_points(cls, annotations): solitary_points = [] for g_id, group in groupby(annotations, lambda a: a.group): - if g_id and not cls.find_instance_anns(group): + if not g_id or g_id and not cls.find_instance_anns(group): group = [a for a in group if a.type == AnnotationType.points] - solitary_points.extend(group) + solitary_points.extend(group) return solitary_points From 24f6a8151e1455aa95269ae271e67a50a31e3b7c Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Thu, 9 Apr 2020 18:22:59 +0300 Subject: [PATCH 3/3] important changes --- CHANGELOG.md | 3 ++- datumaro/datumaro/plugins/coco_format/converter.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40b823f093db..acf32f9d3526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Hidden points (or outsided) are visible after changing a frame - Merge is allowed for points, but clicks on points conflict with frame dragging logic - Removed objects are visible for search -- Add missed task_id and job_id fields into exception logs for the new UI (https://github.com/opencv/cvat/pull/1372) +- Add missed task_id and job_id fields into exception logs for the new UI (https://github.com/opencv/cvat/pull/1372) +- Fixed polygon exporting bug in COCO dataset (https://github.com/opencv/cvat/issues/1387) ### Security - diff --git a/datumaro/datumaro/plugins/coco_format/converter.py b/datumaro/datumaro/plugins/coco_format/converter.py index fe5806af1ec1..2cfe46a5a916 100644 --- a/datumaro/datumaro/plugins/coco_format/converter.py +++ b/datumaro/datumaro/plugins/coco_format/converter.py @@ -1,5 +1,5 @@ -# Copyright (C) 2019 Intel Corporation +# Copyright (C) 2020 Intel Corporation # # SPDX-License-Identifier: MIT