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-demo/bdd100k"
name = "sequence_1"
image_urls = [
"https://segmentsai-prod.s3.eu-west-2.amazonaws.com/assets/jane/a13358ef-a1ae-443c-8ea1-5f61dd9cdc26.jpg",
"https://segmentsai-prod.s3.eu-west-2.amazonaws.com/assets/jane/4f47973f-5568-47f1-8a7d-44bfeb6f0f76.jpg",
]
frames = [
{
"name": "frame_00001.jpg",
"image": {
"url": image_urls[0],
},
},
{
"name": "frame_00002.jpg",
"image": {
"url": image_urls[1],
},
},
]
attributes = {"frames": frames}
sample = client.add_sample(dataset, name, attributes)