From ee8dd831be72c7b0441a8db1bf9e20ca5cc2e216 Mon Sep 17 00:00:00 2001 From: Pavel Bartsits <48913536+cxnt@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:00:15 +0400 Subject: [PATCH] Update utils.py --- src/utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 8114518..cbba15e 100644 --- a/src/utils.py +++ b/src/utils.py @@ -69,7 +69,14 @@ def ann_to_xml(project_info, image_info, img_filename, result_ann_dir, ann): ET.SubElement(xml_root_size, "height").text = str(image_info.height) ET.SubElement(xml_root_size, "depth").text = "3" - ET.SubElement(xml_root, "segmented").text = "1" if len(ann.labels) > 0 else "0" + + is_segmented = 0 + for label in ann.labels: + if label.obj_class.geometry != sly.Rectangle: + is_segmented = 1 + break + + ET.SubElement(xml_root, "segmented").text = is_segmented for label in ann.labels: if label.obj_class.name == "neutral":