Yolo segmentation dataset conversion to a sam dataset

Hello Everyone, I want to use a custom trained sam model to do instance segmentation, but the problem is I currently have a yolo segmentation dataset which i annotated and downloaded from cvat, i used a pretrained yolov8n model the results are not that good so i want to switch to a sam model and train it with my custom dataset. Is there any way to convert my yolo segmenation dataset to a sam dataset, so i dont have to do separate annotations for the sam model from scratch.

1 Like

The Ultralytics SAM implementations don’t support training. You’ll have to find the format that the native SAM model requires for annotations to train one. Alternatively, you could consider a YOLO-E model.

1 Like

I have been working with a custom YOLO segmentation dataset that I annotated and exported from CVAT, but the results from my trained YOLO models (YOLOv8n, YOLOE, and others) aren’t giving me the accuracy I need for detecting damages. Because of this, I want to switch to using the SAM and fine-tune it on my dataset. The problem is that current dataset is in YOLO segmentation format. I am trying to figure out if there’s an existing way to convert YOLO segmentation data into a SAM-compatible dataset without having to redo the annotations from scratch. Has anyone successfully done this before, especially with datasets exported from CVAT? Are there any tools, scripts, or workflows available that can handle this conversion smoothly?

1 Like

If you check the official SAM repository, you would find this script that generates masks automatically

1 Like