From 6ca7f24de43455e999da5f784f2891543d285878 Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Wed, 24 Mar 2021 14:03:56 +0300 Subject: [PATCH] Avoid saving masks in voc when segmentation is not required (#184) * Avoid saving masks in voc when segmentation is not required --- CHANGELOG.md | 1 + datumaro/plugins/voc_format/converter.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 571845018865..1b8631fd0e80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Image reading and saving in ICDAR formats () - Unnecessary image loading on dataset saving () - Allowed spaces in ICDAR captions () +- Saving of masks in VOC when masks are not requested () ### Security - diff --git a/datumaro/plugins/voc_format/converter.py b/datumaro/plugins/voc_format/converter.py index bbf4f8a8ded6..abb109ff9a36 100644 --- a/datumaro/plugins/voc_format/converter.py +++ b/datumaro/plugins/voc_format/converter.py @@ -315,7 +315,7 @@ def save_subsets(self): clsdet_list[item.id] = True - if masks: + if masks and VocTask.segmentation in self._tasks: compiled_mask = CompiledMask.from_instance_masks(masks, instance_labels=[self._label_id_mapping(m.label) for m in masks])