SAM-2 uses a custom dataset format for use in fine-tuning models.
You can convert and export data to the SAM 2 format in Roboflow.
Below, learn the structure of Segment Anything 2.
{"image":{"image_id":3,"license":1,"file_name":"A2_jpg.rf.1aa89274b154e74a1f960fbb192c6bf2.jpg","height":416,"width":416,"date_captured":"2024-10-07T11:35:58+00:00"},"annotations":[{"id":3,"bbox":[92,153,193.077471,199.115617],"area":38444.7397669646,"segmentation":{"counts":"...","size":[416,416]}}]}
With Roboflow supervision, an open source Python package with utilities for completing computer vision tasks, you can merge and split detections in Segment Anything 2. Read our dedicated guides to learn how to merge and split Segment Anything 2 detections.
Below, see model architectures that require data in the Segment Anything 2 format when training a new model.
On each page below, you can find links to our guides that show how to plot predictions from the model, and complete other common tasks like detecting small objects with the model.