From acad7ec13a5f9869599bab5f05bf0dd2cdcdc279 Mon Sep 17 00:00:00 2001 From: Jihyeon Yi Date: Tue, 15 Oct 2024 16:37:39 +0900 Subject: [PATCH] Fix datumaro keypoint loading (#1644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Summary This fixes the bug in loading a keypoint dataset in datumaro format. The visibility information will be filled correctly by this fix. ### How to test ### Checklist - [x] I have added unit tests to cover my changes.​ - [ ] I have added integration tests to cover my changes.​ - [x] I have added the description of my changes into [CHANGELOG](https://github.com/openvinotoolkit/datumaro/blob/develop/CHANGELOG.md).​ - [ ] I have updated the [documentation](https://github.com/openvinotoolkit/datumaro/tree/develop/docs) accordingly ### License - [x] I submit _my code changes_ under the same [MIT License](https://github.com/openvinotoolkit/datumaro/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. - [ ] I have updated the license header for each file (see an example below). ```python # Copyright (C) 2024 Intel Corporation # # SPDX-License-Identifier: MIT ``` --- CHANGELOG.md | 2 ++ src/datumaro/plugins/data_formats/datumaro/base.py | 1 + tests/unit/data_formats/datumaro/conftest.py | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8eb1edf2f..b944af5c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 () ### Bug fixes +- Fix datumaro format to load visibility information from Points annotations + () ## Q4 2024 Release 1.9.1 ### Enhancements diff --git a/src/datumaro/plugins/data_formats/datumaro/base.py b/src/datumaro/plugins/data_formats/datumaro/base.py index a4034269f7..da83a18ced 100644 --- a/src/datumaro/plugins/data_formats/datumaro/base.py +++ b/src/datumaro/plugins/data_formats/datumaro/base.py @@ -339,6 +339,7 @@ def _load_annotations(self, item: Dict): points, label=label_id, id=ann_id, + visibility=ann.get("visibility"), attributes=attributes, group=group, object_id=object_id, diff --git a/tests/unit/data_formats/datumaro/conftest.py b/tests/unit/data_formats/datumaro/conftest.py index 9d08a31700..71fc8b1cd0 100644 --- a/tests/unit/data_formats/datumaro/conftest.py +++ b/tests/unit/data_formats/datumaro/conftest.py @@ -91,7 +91,7 @@ def fxt_test_datumaro_format_dataset(): }, ), Points( - [1, 2, 2, 0, 1, 1], + [1, 2, 0, 0, 1, 1], label=0, id=5, z_order=4, @@ -99,6 +99,7 @@ def fxt_test_datumaro_format_dataset(): "x": 1, "y": "2", }, + visibility=[1, 0, 2], ), Mask( label=3,