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

SAM binary segmentation mask to YOLO format

Open akashsateesha opened this issue 2 years ago • 1 comments

Hey Everyone !!

I have a dataset with only bounding box annotations . I wanted to generate Segmentation masks using the available bounding box and made us of SAM model . SAM gives Segmentation masks in binary format , when I plotted the masks the results very pretty impressive . Now I want to built an instance segmentation model on the above dataset using YOLOV8 or YOLOV5 . But for this I want to convert my Segmentation masks in binary format to YOLO format. I have tried with the opencv"s find contour too but it was a failure . Can some one please guide me there !!

image

Thank You !!

akashsateesha avatar Nov 18 '23 08:11 akashsateesha

Try something like this https://colab.research.google.com/drive/1FJGF47MkLMpU4Kc3qzQumKJ7zqIQfORG?usp=sharing

jamesheatonrdm avatar Jan 30 '24 12:01 jamesheatonrdm