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.

Before You Start

Get started with the Vi SDK →

Why Not Two Calls?

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",
)

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Dataset to list from.
Required
filter_criteria
string | object
Standard asset filter expression.
Optional
None
contents
boolean
Include extended asset content metadata.
Optional
None
metadata_query
string
Query string evaluated against asset metadata.
Optional
None
rule_query
string
Rule-based query.
Optional
None
strict_query
boolean
Require strict matching for queries when true.
Optional
None
annotation_filter
string
Filter expression evaluated against the annotation objects, for example by label or status.
Optional
None
view
string
Platform view preset: 'default' or 'recent'.
Optional
None
page_size
integer
Page size cap.
Optional
None
page
string
Pagination cursor from a previous call.
Optional
None

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"))

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required
asset_id
string
Asset to fetch.
Required
contents
boolean
Include extended asset content metadata.
Optional
None

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.

Entry fields

Name
Type
Description
Required
Default
asset
object
The asset document: identifier, filename, and metadata
Optional
objects
array
Annotation objects attached to the asset. Empty when the asset is unannotated.
Optional

Related resources

Assets API

Upload, download, list, and delete asset files within a dataset.

Annotations API

Upload, list, get, download, and delete annotations.

Dataset Loaders

Load a downloaded dataset into PyTorch for training.

Ontologies API

Manage the label taxonomy that annotations reference.


Did this page help you?