Recipes (examples)

Complete, copy-and-run SDK scripts grouped by domain area

Every example in this section is a complete script that uses argparse. Pass --help to any script to see all options. The same files live in cvat-sdk/examples/.

Shared conventions:

  • Every recipe takes --host and --token. Create a token in the CVAT UI under Profile -> Security. Wrap values that contain URL punctuation in single quotes, e.g. --host 'https://app.cvat.ai'. auth_profile.py and auth_cli.py show alternative sign-in flows.
  • Recipes that create resources keep them and print their ids and UI links. Pass --cleanup to delete what the script created (never the sources it read).
  • Recipes that inspect or export take an existing resource id (--project-id, --task-id), so they work directly against your data.
  • List-valued options accept multiple values, e.g. --labels car person.
  • Missing arguments exit with a friendly message; SDK errors surface as normal Python tracebacks.

All examples are tested in the latest SDK version.

Topics

  • Authenticate — auth_token.py, auth_profile.py, auth_cli.py
  • Projects — create/list, backup, restore, dataset export
  • Tasks — create from a bucket, bulk-create in a project, inspect and export, one task per label group, explicit job file mapping
  • Jobs — list jobs, round-robin assignment, batch-advance stages
  • Annotations — import from a file or a bucket, bulk-edit, per-label statistics, duplicate search
  • Ground truth — validation sets, honeypots, specific ground truth frames
  • Datasets — incremental download, bulk export
  • Cloud storage — attach an S3-compatible bucket
  • Webhooks — register and ping a webhook, receive deliveries locally

Authenticate a client

Copy-and-run auth recipes: PAT (recommended), saved profiles, and the CLI-compatible argument set

Project recipes

Create/list, backup, restore, dataset export — one recipe per file

Task recipes

Create one task or a batch of tasks from a bucket; inspect and export existing tasks

Job recipes

List a task’s or project’s jobs, round-robin unassigned jobs, batch-advance completed jobs

Annotation recipes

Import annotations into a task from a file or a bucket, edit them in bulk, aggregate statistics, and find objects annotated twice

Ground truth recipes

Create validation sets and honeypots, and choose exactly which frames are ground truth

Dataset recipes

Download only what changed, and export many tasks in one run

Cloud storage recipes

Attach an S3-compatible bucket to CVAT via the low-level cloud storages API

Webhook recipes

Register a webhook for task events and watch new tasks appear live with a local receiver