Skip to content

Commit d831c09

Browse files
authored
Merge pull request #793 from superannotateai/fix_upload_annotations
fix _attach_categories in upload multimodal annotations
2 parents 8f158d7 + 0354482 commit d831c09

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/superannotate/lib/core/usecases/annotations.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,9 +2106,11 @@ def execute(self):
21062106
)
21072107
if category:
21082108
item_id_category_map[name_item_map[item_name].id] = category
2109-
self._attach_categories(
2110-
folder_id=folder.id, item_id_category_map=item_id_category_map
2111-
)
2109+
if item_id_category_map:
2110+
self._attach_categories(
2111+
folder_id=folder.id,
2112+
item_id_category_map=item_id_category_map,
2113+
)
21122114
workflow = self._service_provider.work_management.get_workflow(
21132115
self._project.workflow_id
21142116
)
@@ -2147,7 +2149,7 @@ def _attach_categories(self, folder_id: int, item_id_category_map: Dict[int, str
21472149
)
21482150
response.raise_for_status()
21492151
categories = response.data
2150-
self._category_name_to_id_map = {c.name: c.id for c in categories}
2152+
self._category_name_to_id_map = {c.value: c.id for c in categories}
21512153
for item_id in list(item_id_category_map.keys()):
21522154
category_name = item_id_category_map[item_id]
21532155
if category_name not in self._category_name_to_id_map:

0 commit comments

Comments
 (0)