From 03544825be85a285c415767fa3913cf4d7267a0f Mon Sep 17 00:00:00 2001 From: Narek Mkhitaryan Date: Tue, 20 May 2025 12:48:06 +0400 Subject: [PATCH] fix _attach_categories in upload multimodal annotations --- src/superannotate/lib/core/usecases/annotations.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/superannotate/lib/core/usecases/annotations.py b/src/superannotate/lib/core/usecases/annotations.py index 67daff6d..854f1ebd 100644 --- a/src/superannotate/lib/core/usecases/annotations.py +++ b/src/superannotate/lib/core/usecases/annotations.py @@ -2106,9 +2106,11 @@ def execute(self): ) if category: item_id_category_map[name_item_map[item_name].id] = category - self._attach_categories( - folder_id=folder.id, item_id_category_map=item_id_category_map - ) + if item_id_category_map: + self._attach_categories( + folder_id=folder.id, + item_id_category_map=item_id_category_map, + ) workflow = self._service_provider.work_management.get_workflow( self._project.workflow_id ) @@ -2147,7 +2149,7 @@ def _attach_categories(self, folder_id: int, item_id_category_map: Dict[int, str ) response.raise_for_status() categories = response.data - self._category_name_to_id_map = {c.name: c.id for c in categories} + self._category_name_to_id_map = {c.value: c.id for c in categories} for item_id in list(item_id_category_map.keys()): category_name = item_id_category_map[item_id] if category_name not in self._category_name_to_id_map: