diff --git a/src/convert_geometry.py b/src/convert_geometry.py index e4cb5cb..ccd5f79 100644 --- a/src/convert_geometry.py +++ b/src/convert_geometry.py @@ -43,7 +43,8 @@ def convert_annotation(ann_info, img_info, src_meta, dst_meta, rectangle_mark): return sly.Annotation((img_info.height, img_info.width)) new_labels = [] - for binding_key, labels in ann.get_bindings(): + groups = ann.get_bindings() + for binding_key, labels in groups.items(): for label in labels: try: new_cls = dst_meta.obj_classes.get(label.obj_class.name) diff --git a/src/functions.py b/src/functions.py index 412c438..f60b8d1 100644 --- a/src/functions.py +++ b/src/functions.py @@ -77,7 +77,7 @@ def create_coco_dataset(coco_dataset_dir): return img_dir, ann_dir -def get_bbox_labels(bbox_points: List[List[int, int]]) -> List[List[int, int]]: +def get_bbox_labels(bbox_points: List[List[int]]) -> List[List[int]]: """ A helper function to convert list of bbox points into a bbox which contains them all """ @@ -120,7 +120,6 @@ def create_coco_annotation( coco_captions["images"].append(image_coco_ann) groups = ann.get_bindings() - for binding_key, labels in groups.items(): labels: List[sly.Label] if binding_key is not None: # -> converted bitmap labels