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
In the importing_coco.ipynb example, the function coco_segm_annotation_to_normalized_vertices doesn't handle nested segmentation. This is demonstrated below:
defcoco_segm_annotation_to_normalized_vertices(coco_ann, *, img_width, img_height):
""" Convert a COCO segmentation annotation to normalized vertices. Handles segmentation data that is a list of list of list (nested list for each polygon). """coco_segmentations=coco_ann["segmentation"]
ret= []
forcoco_segm_groupincoco_segmentations: # Additional loop to handle extra nestingforcoco_segmincoco_segm_group:
ifcoco_ann["iscrowd"] ==0:
# a single object (iscrowd=0) where polygons are usedvertices= [
point_to_normalized_point(
point={"x": x, "y": y},
img_width=img_width,
img_height=img_height,
origin_location="top_left",
)
forx, yinzip(coco_segm[::2], coco_segm[1::2])
]
ret.append(vertices)
returnret
In the
importing_coco.ipynb
example, the functioncoco_segm_annotation_to_normalized_vertices
doesn't handle nested segmentation. This is demonstrated below:Ideally I would be able to upload cocojson to the platform, but in the meantime I suggest improving this example
The text was updated successfully, but these errors were encountered: