diff --git a/luxonis_ml/data/parsers/base_parser.py b/luxonis_ml/data/parsers/base_parser.py index 93650152..3111245e 100644 --- a/luxonis_ml/data/parsers/base_parser.py +++ b/luxonis_ml/data/parsers/base_parser.py @@ -243,7 +243,8 @@ def _add_task(self, generator: DatasetIterator) -> DatasetIterator: task_name = self.task_name or "" for item in generator: if isinstance(item, dict): - item["task"] = task_name - else: + if "task" not in item: + item["task"] = task_name + elif not item.task: item.task = task_name yield item