Assets With Objects
Access this view through client.assets_with_objects in the Datature Vi SDK.
The platform exposes a dedicated read API that returns an asset along with its annotation objects in a single payload. This is the canonical view behind the labelling UI's grid and detail panes, and the most efficient way to iterate a dataset when you need both asset metadata and current annotations: building training mini-batches, exporting curated subsets, or surfacing review queues.
Filters and queries mirror client.assets.list(), plus an annotation_filter for narrowing by annotation metadata and a view selector for the platform's prebuilt presentation modes.
- Vi SDK installed with authentication configured
- An existing dataset with assets and annotations
Listing assets and then fetching annotations per asset costs one round-trip per asset. This endpoint returns both in one page, which matters when iterating datasets of any real size.
Methods
list()
List assets in a dataset paired with their annotation objects.
page = client.assets_with_objects.list("dataset_abc123")
for entry in page.items:
print(entry["asset"]["filename"], len(entry["objects"]))for entry in client.assets_with_objects(dataset_id="dataset_abc123"):
print(entry["asset"]["filename"], len(entry["objects"]))page = client.assets_with_objects.list(
dataset_id="dataset_abc123",
metadata_query="quality:high",
annotation_filter="hasLabel:true",
contents=True,
page_size=50,
)
for entry in page.all_items():
print(entry["asset"]["assetId"])unlabelled = [
entry["asset"]["assetId"]
for entry in client.assets_with_objects(dataset_id="dataset_abc123")
if not entry["objects"]
]
print(f"{len(unlabelled)} assets still need annotation")page = client.assets_with_objects.list(
dataset_id="dataset_abc123",
view="recent",
)Returns: PaginatedResponse[dict]. A page of {asset, objects} entries.
Raises: ViValidationError if dataset_id is invalid. ViOperationError on an unexpected response shape.
get()
Fetch a single asset together with its annotation objects.
entry = client.assets_with_objects.get(
dataset_id="dataset_abc123",
asset_id="asset_xyz789",
contents=True,
)
for obj in entry["objects"]:
print(obj["label"], obj.get("confidence"))Returns: dict. An {asset, objects} entry document.
Raises: ViValidationError if parameters are invalid. ViNotFoundError if the asset does not exist. ViOperationError on an unexpected response shape.
Response format
Each entry is a dictionary with two keys.
Related resources
Updated 1 day ago
