segment-anything icon indicating copy to clipboard operation
segment-anything copied to clipboard

Coco rle to polygon

Open MacieJayDaaaaa opened this issue 1 year ago • 1 comments

Hello,I am trying to train the YOLOv8-SEG model using SA-1b. Yolov8 requires a Polygon type like x1, y1, x2, y2 ············ I use mask = mask_utils.decode(annotation["segmentation"]) How to convert a mask to a polygon type? Using cv2.findContours will result in excessive data

MacieJayDaaaaa avatar Dec 05 '23 13:12 MacieJayDaaaaa

Why insist on polygon?

1 In SA-1B dataset, many mask have holes, and polygon fails to work well. 2 A better way is to customize yolov8's dataloader for RLE format input.

math-yyj avatar Dec 10 '23 14:12 math-yyj