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

  • Authenticateauth_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
  • Jobs — list jobs, round-robin assignment, batch-advance stages
  • Cloud storage — attach an S3-compatible bucket

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

Cloud storage recipes

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