Is it free to convert Unity Perception JSON to Segment Anything 2?
Yes! It is free to convert Unity Perception JSON data into the Segment Anything 2 format on the Roboflow platform.
Convert annotation formats
In this guide, we show you how to convert data between the Unity Synthetic Data and Segment Anything 2 formats for free. You can use your converted data to train models and other models that support the Segment Anything 2 format.
Yes! It is free to convert Unity Perception JSON data into the Segment Anything 2 format on the Roboflow platform.
Unity Perception is a toolkit for generating datasets for computer vision by using 3D renders.
Below, learn the structure of Unity Perception JSON.
{
"version": "0.0.1",
"captures": [{
"id": "b49f1317-f3ce-42e3-8201-b85b0bd1574b",
"sequence_id": "96bf8ade-5d77-49a4-82e2-dc1ef567ab82",
"step": 0,
"timestamp": 10.0,
"sensor": {
"sensor_id": "edf45916-afec-9881-8d21-922241c54310",
"ego_id": "1ceb788a-8155-4860-99da-2b406536f198",
"modality": "camera",
"translation": [
0.0,
0.0,
0.0
],
"rotation": [
0.0,
0.0,
0.0,
1.0
],
"camera_intrinsic": [
[
0.999999762,
0.0,
0.0
],
[
0.0,
1.77777731,
0.0
],
[
0.2,
0.266666651,
-1.0006001
]
]
},
"ego": {
"ego_id": "1ceb788a-8155-4860-99da-2b406536f198",
"translation": [
-595.11,
1175.75,
487.64
],
"rotation": [
0.0778284,
0.9212198,
-0.246840149,
0.290459484
],
"velocity": null,
"acceleration": null
},
"filename": "RGB2327d665-d71f-4c4f-8c77-66df8fa29202/rgb_2.png",
"format": "PNG",
"annotations": [{
"id": "a6aef966-1fb3-4d59-91df-a44866e81038",
"annotation_definition": "f9f22e05-443f-4602-a422-ebe4ea9b55cb",
"values": [{
"label_id": 1,
"label_name": "person",
"instance_id": 2,
"x": 875.0,
"y": 303.0,
"width": 151.0,
"height": 122.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 3,
"x": 1226.0,
"y": 382.0,
"width": 181.0,
"height": 130.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 1,
"x": 660.0,
"y": 402.0,
"width": 148.0,
"height": 112.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 5,
"x": 1003.0,
"y": 381.0,
"width": 148.0,
"height": 141.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 42,
"x": 831.0,
"y": 389.0,
"width": 230.0,
"height": 225.0
}
]
}]
},
{
"id": "87182978-7b34-4157-85f2-9fa0b57af085",
"sequence_id": "96bf8ade-5d77-49a4-82e2-dc1ef567ab82",
"step": 1,
"timestamp": 20.0,
"sensor": {
"sensor_id": "edf45916-afec-9881-8d21-922241c54310",
"ego_id": "1ceb788a-8155-4860-99da-2b406536f198",
"modality": "camera",
"translation": [
0.0,
0.0,
0.0
],
"rotation": [
0.0,
0.0,
0.0,
1.0
],
"camera_intrinsic": [
[
0.999999762,
0.0,
0.0
],
[
0.0,
1.77777731,
0.0
],
[
0.2,
0.266666651,
-1.0006001
]
]
},
"ego": {
"ego_id": "1ceb788a-8155-4860-99da-2b406536f198",
"translation": [
-595.11,
1175.75,
487.64
],
"rotation": [
0.0778284,
0.9212198,
-0.246840149,
0.290459484
],
"velocity": null,
"acceleration": null
},
"filename": "RGB2327d665-d71f-4c4f-8c77-66df8fa29202/rgb_3.png",
"format": "PNG",
"annotations": [{
"id": "94bffb82-7753-4d79-8294-66e2976d7362",
"annotation_definition": "f9f22e05-443f-4602-a422-ebe4ea9b55cb",
"values": [{
"label_id": 1,
"label_name": "person",
"instance_id": 2,
"x": 875.0,
"y": 303.0,
"width": 151.0,
"height": 122.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 3,
"x": 1226.0,
"y": 382.0,
"width": 181.0,
"height": 130.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 1,
"x": 660.0,
"y": 402.0,
"width": 148.0,
"height": 112.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 5,
"x": 1003.0,
"y": 381.0,
"width": 149.0,
"height": 142.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 42,
"x": 831.0,
"y": 389.0,
"width": 230.0,
"height": 225.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 4,
"x": 1317.0,
"y": 455.0,
"width": 201.0,
"height": 166.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 33,
"x": 454.0,
"y": 462.0,
"width": 213.0,
"height": 216.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 13,
"x": 899.0,
"y": 504.0,
"width": 308.0,
"height": 286.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 16,
"x": 222.0,
"y": 501.0,
"width": 189.0,
"height": 290.0
},
{
"label_id": 4,
"label_name": "hard-hat",
"instance_id": 38,
"x": 295.0,
"y": 685.0,
"width": 113.0,
"height": 173.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 10,
"x": 40.0,
"y": 630.0,
"width": 202.0,
"height": 252.0
},
{
"label_id": 12,
"label_name": "car",
"instance_id": 46,
"x": 827.0,
"y": 712.0,
"width": 257.0,
"height": 229.0
},
{
"label_id": 1,
"label_name": "person",
"instance_id": 26,
"x": 1402.0,
"y": 810.0,
"width": 254.0,
"height": 187.0
},
{
"label_id": 13,
"label_name": "bicycle",
"instance_id": 7,
"x": 667.0,
"y": 641.0,
"width": 298.0,
"height": 394.0
},
{
"label_id": 5,
"label_name": "door",
"instance_id": 31,
"x": 1143.0,
"y": 839.0,
"width": 652.0,
"height": 241.0
}
]
}]
}]
}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]}}]}Roboflow is a universal conversion tool for computer vision annotation formats. The Public plan is the best way for those exploring personal projects, class assignments, and other experiments to try Roboflow. To convert your dataset, start by creating a free workspace on the Public plan.
Once your account has been created, click Create New Project.

Upload your data to Roboflow by dragging and dropping your Unity Perception JSON images and annotations into the upload space.

Next, click "Generate New Version" to generate a new version of your dataset:

You can then apply any preprocessing or augmentation steps to your dataset:

After generating, you will be prompted to Export your dataset. You can choose to receive your dataset as a .zip file or a curl download link. Choose Segment Anything 2 when asked in what format you want to export your data. You will see a dropdown with various options like this:

Congratulations, you have successfully converted your dataset from Unity Perception JSON format to Segment Anything 2 format!
Yes! It is free to convert Unity Perception JSON data into the Segment Anything 2 format on the Roboflow platform.
If you have between a few and a few thousand images, converting data between these formats will be quick. But, the time it takes to convert between data formats increases with the more images you have.
Our team will help you start solving business problems on the first call.
Over 16,000 organizations build with Roboflow.