imantics icon indicating copy to clipboard operation
imantics copied to clipboard

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

Open jrdalenberg opened this issue 1 year ago • 0 comments

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

jrdalenberg avatar Sep 27 '23 11:09 jrdalenberg