Skip to content

convert labelme2coco from AI Mask #1447

Answered by ksv87
ksv87 asked this question in Q&A / Help
Discussion options

You must be logged in to vote

I try change this
https://github.com/labelmeai/labelme/blob/3a1f6554072dbf6e5b4a2cf6f5130399b5a708d5/examples/instance_segmentation/labelme2coco.py#L116-L124

        for shape in label_file.shapes:
            points_origin = shape["points"]
            label = shape["label"]
            group_id = shape.get("group_id")
            shape_type = "polygon"#shape.get("shape_type", "polygon")
            mask = shape.get("mask")
            import labelme.ai._utils as ut
            points = ut.compute_polygon_from_mask(mask)
            points += points_origin[0]
            mask = labelme.utils.shape_to_mask(img.shape[:2], points, shape_type)

            if group_id is None:
              …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ksv87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant