Tag captured data | Viam Documentation

Tag captured data

Tags are short labels you attach to captured items. Use them to mark which items have been reviewed, group items by source or condition, build a dataset for ML training, or narrow the scope of a delete operation.

A few important boundaries:

Apply tags to binary data

The in-app tag UI works for images. For other binary types (files, point clouds, audio), tag with the CLI or the SDK.

  1. On the DATA page, click an image (the Images sub-tab is the default view). A side panel slides in from the right with the ACTIONS tab selected.
  2. In the side panel, scroll to the Tags section.
  3. Type a tag name and press Enter. Click the x next to a tag to remove it.

The Viam app applies tags one image at a time. To tag many items in one operation, or to tag non-image binary data, use the CLI or the SDK.

Tag specific items by their binary data IDs:

viam data tag ids add --tags=reviewed,approved --binary-data-ids=<id1>,<id2>

Remove tags from specific items:

viam data tag ids remove --tags=reviewed --binary-data-ids=<id1>,<id2>

Tag every item that matches a filter (organization, location, MIME type, time range, and more):

viam data tag filter add --tags=reviewed,approved --org-ids=<org-id> --location-ids=<location-id> --mime-types=image/jpeg

Note

The filter-based tag commands (tag filter add and tag filter remove) use deprecated underlying APIs. They still work but may be removed in a future release. Prefer the ID-based commands when possible.

For the full list of flags, see the viam data tag CLI reference.

To find binary data IDs, run viam data export binary filter and read the IDs from the JSON metadata file each download produces, or query through the SDK with BinaryDataByFilter.

binary_ids = ["binary-data-id-1", "binary-data-id-2"]

await data_client.add_tags_to_binary_data_by_ids(
    tags=["reviewed", "approved"],
    binary_ids=binary_ids,
)

The data client API also supports adding and removing tags by filter, removing tags by ID, and listing the distinct tags that match a filter.

binaryIDs := []string{"binary-data-id-1", "binary-data-id-2"}

err := dataClient.AddTagsToBinaryDataByIDs(
    ctx,
    []string{"reviewed", "approved"},
    binaryIDs,
)

Use tags downstream

Once data is tagged, you can use those tags to: