Add a sample with client.add_sample()
. For each sample, specify a name and the required sample attributes. If you do not have URLs for your assets, upload the assets to Segments.ai first.
dataset = "segments/nuscenes-3d-segmentation"
name = "sample_point_cloud_sequence"
pc_urls = [
"https://segmentsai-prod.s3.eu-west-2.amazonaws.com/assets/admin-tobias/73b62f59-cb43-4625-aeb0-6e64ea42b28a.pcd",
"https://segmentsai-prod.s3.eu-west-2.amazonaws.com/assets/admin-tobias/73b62f59-cb43-4625-aeb0-6e64ea42b28a.pcd",
]
frames = [
{
"pcd": {"url": pc_urls[0], "type": "pcd"},
"name": "sample_point_cloud_1",
"timestamp": "1532402927647951",
"ego_pose": {
"position": {"x": -1180.8903791765097, "y": 411.3039349319818, "z": 0},
"heading": {
"qx": -0.0016977771610471074,
"qy": 0.011798001930183783,
"qz": -0.8201446642457809,
"qw": 0.5720320396729045,
},
},
"default_z": -1,
},
{
"pcd": {"url": pc_urls[1], "type": "pcd"},
"name": "sample_point_cloud_2",
"timestamp": "1532402928147847",
"ego_pose": {
"position": {"x": -1176.6769733781416, "y": 409.7431520488096, "z": 0},
"heading": {
"qx": -0.0013288675751650467,
"qy": 0.013917029415654661,
"qz": -0.818440972734323,
"qw": 0.5744205119534879,
},
},
"default_z": -1,
},
]
attributes = {"frames": frames}
sample = client.add_sample(dataset, name, attributes)