From a4ef8488426f6c85b5271fe5203bc315c359bd5d Mon Sep 17 00:00:00 2001 From: Zhiltsov Max Date: Mon, 16 Mar 2020 14:04:07 +0300 Subject: [PATCH 1/2] Fix occluded and z_order attributes export --- cvat/apps/dataset_manager/bindings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cvat/apps/dataset_manager/bindings.py b/cvat/apps/dataset_manager/bindings.py index da37a3048e65..dc1db5740d7c 100644 --- a/cvat/apps/dataset_manager/bindings.py +++ b/cvat/apps/dataset_manager/bindings.py @@ -91,7 +91,9 @@ def categories(self): @staticmethod def _load_categories(cvat_anno): categories = {} - label_categories = datumaro.LabelCategories() + + label_categories = datumaro.LabelCategories( + attributes=['occluded', 'z_order']) for _, label in cvat_anno.meta['task']['labels']: label_categories.add(label['name']) @@ -144,6 +146,8 @@ def convert_attrs(label, cvat_attrs): anno_group = shape_obj.group anno_label = map_label(shape_obj.label) anno_attr = convert_attrs(shape_obj.label, shape_obj.attributes) + anno_attr['occluded'] = shape_obj.occluded + anno_attr['z_order'] = shape_obj.z_order anno_points = shape_obj.points if shape_obj.type == ShapeType.POINTS: @@ -234,7 +238,7 @@ def import_dm_annotations(dm_dataset, cvat_task_anno): frame=frame_number, label=label_cat.items[ann.label].name, points=ann.points, - occluded=False, + occluded=ann.attributes.get('occluded') == True, group=group_map.get(ann.group, 0), attributes=[cvat_task_anno.Attribute(name=n, value=str(v)) for n, v in ann.attributes.items()], From 79f532c72718640173af192f30f49af62c554bfd Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Tue, 17 Mar 2020 14:54:52 +0300 Subject: [PATCH 2/2] Add line to changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08adf7f8d2a6..696c02f8d2ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ### Changed -- +- ### Deprecated - @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ### Fixed -- +- `occluded` and `z_order` annotation attributes are now correctly passed to Datumaro ([#1271](https://github.com/opencv/cvat/pull/1271)) ### Security - Bump acorn from 6.3.0 to 6.4.1 in /cvat-ui ([#1270](https://github.com/opencv/cvat/pull/1270))