You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
Thank you for putting the effort on creating this great repo.
I am trying to convert binary images to coco annotations, but i get this error. can you please explain why is this happening and how can i solve it. I also googled it, but have not been lucky yet.
"""
AttributeError Traceback (most recent call last)
Input In [5], in
84 coco_format["categories"] = create_category_annotation(category_ids)
86 # Create images and annotations sections
---> 87 coco_format["images"], coco_format["annotations"], annotation_cnt = images_annotations_info(mask_path)
89 with open("output/{}.json".format(keyword),"w") as outfile:
90 json.dump(coco_format, outfile)
Input In [5], in images_annotations_info(maskpath)
50 category_id = category_colors[color]
52 # "annotations" info
---> 53 polygons, segmentations = create_sub_mask_annotation(sub_mask)
55 # Check if we have classes that are a multipolygon
56 if category_id in multipolygon_ids:
57 # Combine the polygons to calculate the bounding box and area
Hi
Thank you for putting the effort on creating this great repo.
I am trying to convert binary images to coco annotations, but i get this error. can you please explain why is this happening and how can i solve it. I also googled it, but have not been lucky yet.
"""
AttributeError Traceback (most recent call last)
Input In [5], in
84 coco_format["categories"] = create_category_annotation(category_ids)
86 # Create images and annotations sections
---> 87 coco_format["images"], coco_format["annotations"], annotation_cnt = images_annotations_info(mask_path)
89 with open("output/{}.json".format(keyword),"w") as outfile:
90 json.dump(coco_format, outfile)
Input In [5], in images_annotations_info(maskpath)
50 category_id = category_colors[color]
52 # "annotations" info
---> 53 polygons, segmentations = create_sub_mask_annotation(sub_mask)
55 # Check if we have classes that are a multipolygon
56 if category_id in multipolygon_ids:
57 # Combine the polygons to calculate the bounding box and area
File ~/Desktop/Py_js/Data/python_with_vlad/pycharm/polymore/Binary-Image_to_coco/image-to-coco-json-converter-master/src/create_annotations.py:56, in create_sub_mask_annotation(sub_mask)
52 continue
54 polygons.append(poly)
---> 56 segmentation = np.array(poly.exterior.coords).ravel().tolist()
57 segmentations.append(segmentation)
59 return polygons, segmentations
AttributeError: 'MultiPolygon' object has no attribute 'exterior'
"""
Thanks in advance.
The text was updated successfully, but these errors were encountered: