Skip to main content
A batch is a single run — one query, one schema, over some videos. A dataset is the thing you hand to someone else: a union of batch runs, materialised server-side into one download containing every batch’s full results.
Curated datasets are admin-only. If your account is not an admin the SDK says so rather than returning a bare 403; use client.video.get_batch_analysis(batch_id) to pull a single batch’s results instead.

Create one

Pass the batch you just ran, a batch id, or a list of either:
Several batches, plus raw footage
create_from_batch waits for the background build to finish by default, so dataset.event_counts is final when it returns. Pass wait=False to get the id immediately and poll later with client.datasets.wait(dataset_id). If a batch’s results cannot be read during the build, the dataset ends in error rather than ready and names the batches in dataset.failed_batches. Its download is still written, so nothing that did read is lost — but a dataset silently missing a whole batch should not present itself as complete. Retry with client.datasets.update(dataset_id, refresh=True).

What lands in it

The grain is batch-scoped, not video-scoped. For each batch, the backend reads exactly the analysis that batch produced for each of its videos. So:
  • A video’s events come from the batch you named — not from everything that video has ever been analysed for.
  • A video in two batches of the dataset appears twice, once per batch, each time with that batch’s events. That is deliberate: two batches usually asked different questions, and their rows are not comparable.
  • video_ids are unanalysed extras. They land in unanalyzed_videos as bare {video_id, filename} records with no events.

Read it back

Events keep whatever their run produced, so a batch that carried an output_schema brings its structured_output along and those fields become columns. A dataset can mix schema and non-schema batches — batches without one simply contribute no schema columns. If a schema field is itself called batch_id, the schema field keeps the column and the batch id moves to event_batch_id.

Manage it

Any change to what is in the dataset rebuilds its download by default, and a rebuild is asynchronous — pass wait=True when you need final totals, or a working download, before reading it. A rename alone never triggers one. refresh=False skips the rebuild for video additions and for removals; it cannot skip one for add_batches, since the backend always reprocesses added batches to compute their event counts. A rename on its own does not rebuild: the dataset is renamed immediately, but the name embedded in an already-written download stays as it was until the next rebuild. Pass refresh=True alongside the rename if the download’s own metadata has to match.