sdk-automation
Automate CVAT with the Python SDK, high-level repositories, authentication helpers, and safe task/project data scripts.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- sdk-automation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Automate CVAT with the Python SDK, high-level repositories, authentication helpers, and safe task/project data scripts.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md8.2 KB
- 参考文档references/troubleshooting.md4.0 KB
- 参考文档references/workflows.md5.3 KB
- 脚本scripts/sdk_task_smoke_template.py3.6 KB
03 SKILL.md 正文
CVAT SDK automation
Use this sub-skill when a task needs Python code against a CVAT server: login with a Personal Access Token or password, reuse CLI profiles, create/list/update/delete tasks or projects, upload local/remote/shared data, import/export annotations or datasets, download frames/previews/backups, use organization context, or fall back to generated low-level REST API wrappers.
Route first
- Read
references/api-reference.mdfor confirmed public classes, signatures, defaults, auth/profile helpers, and repository/entity relationships. - Read
references/workflows.mdfor copyable SDK patterns for task/project creation, frame download, import/export, backups, profile-compatible scripts, and low-level API fallback. - Read
references/troubleshooting.mdwhen imports, authentication, server compatibility, background requests, SSL, organization context, or cache/filesystem behavior fail. - Run or adapt
scripts/sdk_task_smoke_template.pyfor a safe import/signature smoke by default, or for an explicit authenticated list/download workflow when the user supplies server credentials.
Use SDK instead of CLI when
- The user needs branching logic, error handling, Python data structures, or integration into an ML pipeline.
- A workflow needs
Client,Task,Project,Job,Organization,Issue, or generated API model objects. - The task must compose CVAT calls with local data processing, model inference, or dataset conversion.
- Repeated background operations should use
wait_for_completion()rather than shell polling.
Use ../cli-automation/SKILL.md for terminal-only commands, ../dataset-ops/SKILL.md for format and PyTorch dataset choices, ../auto-annotation/SKILL.md for AA function protocols, and ../deployment-admin/SKILL.md for starting or administering a CVAT service.
Minimal install and import checks
pip install cvat-sdk
python - <<'PY'
from cvat_sdk import make_client, Client, Config
from cvat_sdk.core.proxies.tasks import ResourceType
print(Client, Config, [str(x) for x in ResourceType])
PY
Use extras only when needed:
pip install "cvat-sdk[masks]" # mask encode/decode helpers needing NumPy
pip install "cvat-sdk[pytorch]" # PyTorch dataset adapter and built-in torchvision AA functions
Safe authentication defaults
- Prefer PAT authentication (
access_token=) or CLI-compatible profiles rather than hard-coded passwords. - If using password auth, pass it as a secret runtime value, not in code committed to a repository.
- Include the scheme in the server URL (
http://orhttps://); SDK defaults and compatibility checks are stricter in recent releases. - Set
organization_slugor useorganization_context(slug)when the workflow must operate inside an organization workspace. - Treat
config.allow_unsupported_server=Truewarnings seriously: SDK/server minor versions should normally match or be adjacent.
Core pattern
from cvat_sdk import make_client, models
from cvat_sdk.core.proxies.tasks import ResourceType
with make_client("https://cvat.example.com", access_token=token) as client:
client.organization_slug = "team-slug" # omit for personal workspace
task = client.tasks.create_from_data(
spec=models.TaskWriteRequest(
name="demo",
labels=[{"name": "car", "type": "rectangle"}],
),
resource_type=ResourceType.LOCAL,
resources=["image1.jpg", "image2.jpg"],
)
print(task.id, task.size)
Keep scripts explicit about side effects: creating tasks/projects, importing annotations, deleting resources, and downloading frames all mutate or read server state and need user-approved credentials/server targets.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).