Skip to content

Commit 29d7097

Browse files
committed
Fix KeyError - fill-classes
1 parent 36d1070 commit 29d7097

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

superannotate/db/annotation_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ def fill_class_and_attribute_ids(annotation_json, annotation_classes_dict):
347347
annotation_classes_dict = {**annotation_classes_dict, **unknown_classes}
348348
templates_map = get_templates_mapping()
349349
for ann in (
350-
i for i in annotation_json["instances"] if i['type'] == 'template'
350+
i for i in annotation_json["instances"] if i.get('type', None) == 'template'
351351
):
352-
ann['templateId'] = templates_map.get(ann['templateName'], -1)
352+
ann['templateId'] = templates_map.get(ann.get('templateName', ''), -1)
353353
for ann in annotation_json["instances"]:
354354
if "className" not in ann:
355355
logger.warning("No className in annotation instance")

0 commit comments

Comments
 (0)