From 9e0270bd59a41a680877c4397bcb79d5429c253e Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Mon, 23 Mar 2020 19:21:53 +0300 Subject: [PATCH] Fix attributes with spaces in names --- datumaro/datumaro/components/dataset_filter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datumaro/datumaro/components/dataset_filter.py b/datumaro/datumaro/components/dataset_filter.py index f5d923bef79c..2d01f23a7df6 100644 --- a/datumaro/datumaro/components/dataset_filter.py +++ b/datumaro/datumaro/components/dataset_filter.py @@ -48,7 +48,7 @@ def encode_annotation_base(cls, annotation): ET.SubElement(ann_elem, 'type').text = str(annotation.type.name) for k, v in annotation.attributes.items(): - ET.SubElement(ann_elem, k).text = str(v) + ET.SubElement(ann_elem, k.replace(' ', '-')).text = str(v) ET.SubElement(ann_elem, 'group').text = str(annotation.group)