Skip to content

segmentation is removed in coco export when a single polygon is supplied #62

@jrdalenberg

Description

@jrdalenberg

When annotation['segmentation'] contains a single polygon list that is not provided as a list of lists but as a single list of coordinates, the logic in https://github.com/jsbroks/imantics/blob/master/imantics/annotation.py#L286 removes the entire segmentation.

I do not get any warnings or errors in my pseudo code below when I start creating a dataset:

                        # Add image to coco database
                        ds_im = Image.from_path(im_path)
                        ds_poly = Polygons(json.loads(im_polygon_path))
                        ds_im.add(ds_poly, category=Category(polygon_label))
                        img_set.append(ds_im)

Perhaps a quick fix for you @george-gca in #58

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions