選項
首頁首頁 Skill 開發營運和 CI/CD vss-deploy-detection-tracking-2d

vss-deploy-detection-tracking-2d

NVIDIA/skills NVIDIA/skills

部署、除錯及運作 RTVI-CV 2D 偵測/追蹤微服務,並呼叫其 REST API 以進行串流管理、狀態檢查及指標監控。

...展開全部
1
更新時間 2026-09-28

目的

部署、除錯及操作 RTVI-CV 偵測/追蹤 2D 微服務,並驅動其 REST API。

先決條件

  • 可透過$HOST_IP存取的活躍 VSS 部署(請參閱vss-deploy-profile及references/)。
  • $NGC_CLI_API_KEY和$NVIDIA_API_KEY中須有 NGC 憑證,以便拉取任何映像檔。
  • 呼叫端需具備curl、jq 及 Docker。

操作說明

請遵循以下路由表與逐步工作流程。每個以「工作流程」、「快速入門」或「流程」結尾的章節,皆應由上至下依序執行。詳細參考資料存放於references/ 目錄中,輔助腳本則存放於scripts/ 目錄中—— 當技能以名稱指向特定腳本時,請透過run_script呼叫該腳本。

範例

已驗證的端到端範例存放於evals/目錄下(每個*.json清單皆包含可執行的情境),並內嵌於下方的各工作流程curl區塊中。請執行 Tier-3 評估(使用nv-base validate --agent-eval)以重現這些範例。

限制

  • 需部署相應的 VSS 設定檔/微服務,且呼叫方能存取該資源。
  • 由 NGC 託管的模型和 NIM 可能會受到速率限制、GPU 記憶體需求以及授權限制的約束。
  • 並發數、GPU 記憶體及儲存空間的限制取決於主機硬體及配置檔的 compose 檔案。

疑難排解

  • 錯誤:REST 呼叫傳回「連線遭拒絕」。原因:目標微服務未運行。解決方案:探測/docs或/health;透過vss-deploy-profile或對應的vss-deploy-*技能重新部署。
  • 錯誤:NGC 拉取時出現 HTTP 401/403 錯誤。原因:缺少或過期的NGC_CLI_API_KEY。解決方案:執行 `docker login nvcr.io`,並在重試前重新匯出金鑰。
  • 錯誤:容器發生 OOM 或模型無法載入。原因:所選設定檔的 GPU 記憶體不足。解決方案:切換至較小的變體,或透過 `docker compose down` 釋放 GPU 資源。

RTVI-CV — 偵測與追蹤(統一技能)

Real Time Video Intelligence CV (RTVI-CV)微服務的統一技能。單一技能中包含兩個操作介面:

  • 在本地端部署/操作/除錯/終止RTVI-CV 容器 → 請參閱references/deploy-vss-detection-tracking-2d.md
  • 在運行中的實例上呼叫 RTVI-CV REST API(串流、狀態、指標、嵌入向量)→ 請參閱references/usage-vss-detection-tracking-2d.md

服務:rtvi-cv(metropolis_perception_app) 映像檔:nvcr.io//:— 由使用者於部署時提供 REST 埠號:9000(/api/v1—/live、/ready、/startup、/metrics、/stream/add、/stream/remove、embeddings) 硬體:x86/aarch64 獨立顯示卡 (T4、A100、L40、H100、B200、RTX)、SBSA (Spark、Grace-Hopper)、Jetson (Thor、Orin、Xavier)

動作路由 — 每次呼叫僅選擇一次

使用者意圖(範例措辭) 流程 載入此參考範例
部署 rtvi-cv warehouse 2d ,執行 rtvicv warehouse-3d(4 個串流),啟動 smartcity gdino ,啟動感知應用程式 ,啟動 sparse4d 部署 references/deploy-vss-detection-tracking-2d.md
停止 rtvi-cv、解除部署、終止感知容器、清理 rtvicv-perception-docker 拆卸(由部署文件處理 → 「模式選擇」) references/deploy-vss-detection-tracking-2d.md+references/teardown-flow.md
檢查 rtvi-cv 日誌、診斷 rtvi-cv 當機、排除健康檢查失敗問題、解決 rtvi-cv 無法啟動 除錯 參考文件:references/deploy-vss-detection-tracking-2d.md+references/troubleshooting.md
新增串流、移除攝影機、列出串流、執行健康檢查、確認 rtvi-cv 是否就緒、取得指標、查看 FPS、檢查 GPU 使用率、產生文字嵌入向量、呼叫 rtvi-cv API API 使用說明 references/usage-vss-detection-tracking-2d.md+references/api-reference.md

選擇規則:將使用者的表述與上表進行比對,並立即載入對應的參考檔案。請勿混淆流程 —「部署 (DEPLOY)」假設尚未有運作中的容器;「API 使用說明 (API USAGE)」則假設容器已在http://:9000 上運行。

若意圖確實存在歧義(例如,使用者僅說「我想使用 rtvi-cv」),請提出一個AskQuestion:是要部署新實例,還是呼叫已運行的實例?

檔案存放位置

vss-deploy-detection-tracking-2d/
├── SKILL.md          # 本檔案(路由 + 合約)
├── assets/           # 資料檔案(deploy-defaults.yml — 標籤/參照/路徑/GPU 的唯一可信來源)
├── evals/            # 第 3 層評估清單 (deploy-evals.json, usage-evals.json)
├── scripts/          # 23 個 bash + python 輔助程式(完整清單請參閱 `scripts/`)
└── references/       # 工作流程執行手冊(部署 / API 使用 / 清理 / 疑難排解 / …)

如需完整的檔案清單及各參考文件涵蓋的內容,請參閱 references/workflow-reference.md。

所有腳本皆透過$SKILL_DIR/scripts/從技能根目錄調用 — 部署參考文件內的路徑均原樣保留,當代理程式從技能根目錄執行時,這些路徑可正確解析。

可用腳本

輔助程式位於scripts/目錄中,並可透過名稱從技能根目錄呼叫 — 請透過run_script("scripts/")呼叫各輔助程式,以便代理程式記錄 正確的工具呼叫。

腳本 用途 參數
load_defaults.sh 偵測平台(x86 dGPU / SBSA / Jetson),並從assets/deploy-defaults.yml 檔案解析 YAML 預設值。 --用例
fetch_resources.sh 下載並解壓縮 NGC 資源,並掃描佈局檔案。 --ngc-ref(可選)
apply_in_container.sh 用於步驟 4 的主機端封裝腳本(執行中的容器內之apply_config.sh)。
apply_config.sh 容器內的路徑替換、批次處理、匯出端、來源端及引擎快取。
start_app_in_container.sh 步驟 5 的主機端封裝腳本(對應於run_app_and_wait.sh)。
run_app_and_wait.sh 容器內應用程式啟動 + 就緒狀態 + 指標 + 日誌。
add_streams.sh/update_stream_sources.sh 步驟 6 的 REST 串流生命週期。 ...
collect_metrics.sh 擷取/api/v1/metrics快照。 無
discover_streams.sh 透過/stream/get-stream-info 列出活躍的串流。 無
synthesize_docker_run.sh 針對已解析的環境變數,輸出符合該平台規範的Docker 執行指令。 無
render_box.sh 渲染固定寬度的分步收據。
calibration_manager.py 管理校準 artefact 並執行各使用案例引擎快取的失效處理。 --usecase --reset

如需查看所有輔助程式(快取、GPU 檢查、設定)的完整清單,請瀏覽 scripts/;每個腳本的--help選項會說明其引數。

如何使用此技能

  1. 請先閱讀此檔案。本工具僅負責路由 — 並不包含工作流程。
  2. 根據上方的路由表,將使用者的意圖與之進行比對。
  3. 僅載入一份參考文件(DEPLOY 或 API USAGE)。請勿同時預載兩者——每份參考文件體積龐大,且各自包含完整的合約內容。
  4. 請嚴格遵循已載入的參考文件。這些參考文件是從前代技能 vss-deploy-detection-tracking-2d (deploy/teardown/debug)及rtvicv-api(REST API)中字節對字節完整保留的合約——每個步驟順序不變、bash 批次處理規則、框式渲染規則以及AskQuestion合約均予以保留。
  5. 對於 DEPLOY,參考文件會強制執行其自身的啟動合約:一行確認 → 呼叫規劃工具(TodoWrite陣列包含 5 項待辦事項,或在較新的 Claude Code 上連續呼叫 5 次TaskCreate)→ 步驟 1 的問題。 請勿進行敘述、請勿執行預檢,且絕不要輸出「正在載入 TodoWrite/TaskCreate」或任何關於延遲工具解析的敘述文字——規劃工具將在無聲狀態下載入。

輸出合約 — DEPLOY 流程

執行 DEPLOY / TEARDOWN / DEBUG 流程時,代理程式在每次成功部署後必須遵守 以下四項規定。這些是使用者 在各步驟間唯一的回饋管道;跳過其中任何一項皆屬 行為退化。

  1. 將每個步驟的結束結果渲染於固定寬度的框中——步驟 1部署 目標、步驟 2管線配置、步驟 3容器、步驟 4 套用配置、步驟 5規劃+結果。不僅僅是最終 摘要。 該方框即為使用者的步驟收據。其幾何形狀固定(參見 下文§「通用方框格式」)。各步驟的內容規則(哪些 行應置於每個方框內)位於references/deploy-vss-detection-tracking-2d.md 中的「步驟 N 方框內容規則」部分。
  2. 在「步驟 5 結果」方塊之後,執行來自references/next-steps.md§「11.c」的 「步驟 6AskUserQuestion」 ——切勿以自由格式的「下一步」項目符號清單取代。該 選單是部署流程的退出入口:它讓使用者能透過單次點擊執行指標分析、 管理資料流、監看日誌,或進行清理,而不必 費心記住 curl URL。
  3. 在使用者選取「步驟 6」的儲存桶後,執行來自references/next-steps.md §「11.d」的後續 AskUserQuestion——切勿以散文說明 + 可直接複製的 curl 範例 + 一個 自由文字形式的「要我執行 X 嗎?」問題來取代。 每個桶都有其專屬的 具體動作選單;使用者選擇動作後,技能 便會發出 API 輸入框並執行 curl 指令。各桶的後續操作:
    • 管理串流→ 新增 / 移除 / 列出。移除操作會從 /stream/get-stream-info動態建構選項— 每個 活躍串流對應一個選項,標籤為 · , 且當ACTIVE > 1時會顯示「移除全部」(完整規格:§「remove_streams 子流程」)。
    • 停止部署→ 停止應用程式 / 停止容器 / 完全拆除。
    • 檢查指標與 FPS→ 無後續處理;在輸出/api/v1/metricsAPI 框後 直接執行collect_metrics.sh。
    • 檢查存活狀態/就緒狀態→ 無後續動作;在輸出所有三個 健康檢查端點的 API 框後,對其進行探測。
  4. 渲染完整的「每步驟」內容,而非概覽行— 渲染方塊是必要的,但並非充分條件。每個步驟都有 一項行組成規範,位於 references/deploy-vss-detection-tracking-2d.md 的「步驟 N 方塊內容規則」下。步驟 4(套用配置)是 代理程式最常發生崩潰之處— 其標準 「按使用案例」的鍵值清單位於 references/apply-config.md §「按使用案例的完整編輯清單」中,且代理程式必須發送一個 ✔ [section] key=value — 註解列,針對該表格中每個金鑰,對應 當前使用案例及設定。若一節有 5 個金鑰 → 5 行;若 一節有 6 個金鑰 → 6 行。絕不可每節僅有一行概覽。

禁止(這些是代理程式在 壓力下會退而求其次的捷徑,且會破壞使用者的使用者體驗):

  • ❌內部工具載入敘述。絕不可顯示「我需要載入 TodoWrite(技能為任務小工具呼叫的延遲工具)」, 「正在載入 TaskCreate…」,「呼叫 ToolSearch 以取得規劃工具…」, 或任何其他關於解析/載入/擷取延遲工具的文字。 代理程式應在後台靜默載入工具。使用者僅會看到✔摘要行,其後緊接小工具——絕不應顯示 任何關於工具解析的輔助說明。
  • ❌將所有 5 個部署步驟壓縮至單一TaskCreate 的 描述欄位中。當TaskCreate是可用的規劃 工具時,應連續發出5 次獨立的TaskCreate呼叫(每 個步驟一次)。 請參閱references/task-list.md§「初始TaskCreate呼叫」 以獲取原文字樣範本。TodoWrite亦遵循相同規則 — 單次呼叫並將 所有 5 項待辦事項放入todos:[…]陣列中;絕不讓單項待辦事項的內容 為多行清單。
  • ❌默認選擇動態串流模式。此技能的預設值為 stream_mode=static— 代理程式會在應用程式啟動前,將自動偵測到的file://URL 嵌入 DS 主設定檔的[source-list]區塊中。 僅在用戶明確要求時(「稍後透過 REST 新增串流」、「使用動態串流模式」)或 在第 2 步驟的 AskQuestion 中選擇動態模式時,才切換至動態模式。 若針對「部署 具有 N 個串流的 rtvi-cv」這類通用查詢選擇動態模式,將破壞部署規範並 違背使用者對/metrics的預期。詳見 references/pipeline-config.md §「預設值 — 技能預設為靜態模式」以了解完整 理由。
  • ❌ 僅有一行文字✔ 應用程式將於 Ns 內就緒,N 個串流,總 fps 為 Y,取代 第 5 步驟的「結果」方塊。
  • ❌ 使用 ASCII 方框繪製字元 (+,-,=,*) 取代輕量級 方框繪製字元 (┌ ─ ┐ │ └ ┘)。
  • ❌ 基於「使用者知道下一步該做什麼」的假設而跳過第 6 步。
  • ❌ 在第 6 步驟之後,傾倒一大段 Markdown 文字 + 多個 curl 區塊 + 結尾的「要我執行其中任何一個嗎?」——這就是 代理程式回退的模式,且它繞過了 11.d 選單 以及每個 API 呼叫的對話方塊。 使用者從選單中選擇;技能 顯示已解析的 API 對話方塊;技能執行該指令。不允許自由文字提問。
  • ❌ 第 4 步驟的概覽會折疊 —— 這些是被 部署文件中第 4 步驟內容規則明確禁止的:
    • ✔ 批次大小 3(拼圖網格:1×3)→ 要求:5 行獨立顯示 ([streammux] batch-size=3,[primary-gie] batch-size=3, [source-list] max-batch-size=3,[tiled-display] rows=1, [tiled-display] columns=3)。
    • ✔ 輸出匯流管 eglsink→ 要求:每個匯流管金鑰對應一行 (eglsink 有 4 個金鑰,例如[sink0] enable=1,type=2, sync=0,qos=0— 請參閱 apply-config.md 以獲取確切清單)。
    • ✔ 靜態來源 (3 個串流,http-port=9000)→ 要求:六個 帶註解的[source-list]行。
    • ✔ 拼圖網格 1 行 × 3 列(單一行)→ 要求:兩 行,分別為[tiled-display] rows=1和[tiled-display] columns=3。

通用方塊格式

每個步驟輸出框(步驟 1 至步驟 5 結果)的幾何規格。所有框體形狀相同;僅標題與 正文行會隨步驟變化。

  • 寬度:對角線長度為128 個字元—┌位於第 1 欄,┐位於 第 128 欄。 較寬的終端字元會使方框左對齊;請勿拉伸 方框。內部內容區域為124 個字元(在 │邊框內每側各留一個空格邊距)。
  • 僅使用輕量級框線繪製字元:┌ ─ ┐ │ └ ┘。不得使用+、-、=、 * 等ASCII 替代字元。
  • 頂部邊框 — 標題居中:┌+ N₁ 個破折號 +␣+ 標題 +␣
    • N₂ 個破折號 + ┐,其中N₁ + N₂ + len(標題) + 2 = 126。 分配 填充符號:N₁ = floor((126 − 標題長度 − 2) / 2), N₂ = 126 − 標題長度 − 2 − N₁。N₁ 與 N₂ 的差值至多為 1。
  • 正文:每個事實對應一行│ │。 每行事實採用 ✔ 格式(向內縮兩 個空格,圖形,鍵值向右對齊至 13,兩個空格,數值)。
  • 群組間的空白行:在 邏輯群組之間(例如步驟 1 中的「身分」/「模型」/「影片」)渲染│<124 spaces> │,以便 使用者能一目了然地掃視該區塊。
  • 底部邊框:└+ 126 個短線 +┘— 實線邊框,無標題。

標準步驟標題(用於各步驟方框頂端):

┌─────────────────────────────────────────────────────── 部署目標 ───────────────────────────────────────────────────────┐
┌─────────────────────────────────────────────────── 管線配置 ───────────────────────────────────────────────────┐
┌───────────────────────────────────────────────────────── 容器 ──────────────────────────────────────────────────────────┐
┌──────────────────────────────────────────────────── 套用設定 ─────────────────────────────────────────────────────┐
┌──────────────────────────────────────────────── 感知應用 — 計畫 ───────────────────────────────────────────────┐
┌────────────────────────────────────────────── 感知應用 — 結果 ──────────────────────────────────────────────┐

每步驟的內容規則(哪些列應置於哪個方框中、依模式自動隱藏列 、apply-config 的分區佈局,以及第 5 步驟「先規劃再結果」 模式、第 3 步驟的Docker run合成需求)位於 references/deploy-vss-detection-tracking-2d.md 檔案中的「第 N 步驟方塊內容規則」部分——渲染 對應步驟時請參閱該內容。

快速觸發詞(助記詞)

短語 流程
部署 2D RTVICV 倉庫(含 4 個資料流)並顯示 DEPLOY
在 GPU 1 上執行 smartcity gdino DEPLOY
停止感知容器 TEARDOWN(部署文件)
rtvi-cv 狀態檢查失敗 除錯(部署文件 + 疑難排解)
將串流新增至 rtvi-cv API 使用說明
rtvi-cv 在 localhost:9000 上是否已就緒 API 使用方法
取得 rtvi-cv 指標 API 使用方法
透過 rtvi-cv 產生文字嵌入向量 API 使用方式

bump:1

在 GitHub 上查看
---
name: vss-deploy-detection-tracking-2d
description: Deploy, debug, and operate the RTVI-CV 2D detection/tracking microservice and call its REST API for stream management, health checks, and metrics.
license: Apache-2.0
---
## Purpose

Deploy, debug, and operate the RTVI-CV detection / tracking 2D microservice and drive its REST API.

## Prerequisites

- Active VSS deployment reachable on `$HOST_IP` (see `vss-deploy-profile` and `references/`).
- NGC credentials in `$NGC_CLI_API_KEY` and `$NVIDIA_API_KEY` for any image pulls.
- `curl`, `jq`, and Docker available on the caller.

## Instructions

Follow the routing tables and step-by-step workflows below. Each section that ends in *workflow*, *quick start*, or *flow* is intended to be executed top-to-bottom. Detailed reference material lives in `references/` and helper scripts live in `scripts/` — call them via `run_script` when the skill points to a script by name.

## Examples

Worked end-to-end examples are kept under `evals/` (each `*.json` manifest contains a runnable scenario) and inline in the per-workflow `curl` blocks below. Run a Tier-3 evaluation with `nv-base validate <this-skill-dir> --agent-eval` to replay them.

## Limitations

- Requires the matching VSS profile / microservice to be deployed and reachable from the caller.
- NGC-hosted models and NIMs may be subject to rate-limits, GPU memory requirements, and license restrictions.
- Concurrency, GPU memory, and storage limits depend on the host hardware and the profile's compose file.

## Troubleshooting

- **Error**: REST call returns connection refused. **Cause**: target microservice not running. **Solution**: probe `/docs` or `/health`; redeploy via `vss-deploy-profile` or the matching `vss-deploy-*` skill.
- **Error**: HTTP 401/403 from NGC pulls. **Cause**: missing/expired `NGC_CLI_API_KEY`. **Solution**: `docker login nvcr.io` and re-export the key before retrying.
- **Error**: container OOM or model fails to load. **Cause**: insufficient GPU memory for the selected profile. **Solution**: switch to a smaller variant or free GPUs via `docker compose down`.

# RTVI-CV — Detection & Tracking (Unified Skill)

Unified skill for the **Real Time Video Intelligence CV (RTVI-CV)** microservice. Two action surfaces in one skill:

- **Deploy / operate / debug / tear down** the RTVI-CV container locally → see [`references/deploy-vss-detection-tracking-2d.md`](references/deploy-vss-detection-tracking-2d.md)
- **Call the RTVI-CV REST API** (streams, health, metrics, embeddings) on a running instance → see [`references/usage-vss-detection-tracking-2d.md`](references/usage-vss-detection-tracking-2d.md)

> **Service**: `rtvi-cv` (`metropolis_perception_app`)
> **Image**: `nvcr.io/<org>/<repo>:<tag>` — user-supplied at deploy time
> **REST port**: `9000` (`/api/v1` — `/live`, `/ready`, `/startup`, `/metrics`, `/stream/add`, `/stream/remove`, embeddings)
> **Hardware**: x86/aarch64 dGPU (T4, A100, L40, H100, B200, RTX), SBSA (Spark, Grace-Hopper), Jetson (Thor, Orin, Xavier)

---

## Action routing — pick once per invocation

| User intent (sample phrasing) | Flow | Load this reference |
|-------------------------------|------|---------------------|
| `deploy rtvi-cv warehouse 2d`, `run rtvicv warehouse-3d with 4 streams`, `start smartcity gdino`, `launch perception app`, `bring up sparse4d` | **DEPLOY** | [`references/deploy-vss-detection-tracking-2d.md`](references/deploy-vss-detection-tracking-2d.md) |
| `stop rtvi-cv`, `tear down`, `kill the perception container`, `cleanup rtvicv-perception-docker` | **TEARDOWN** (handled by deploy doc → "Mode Selection") | [`references/deploy-vss-detection-tracking-2d.md`](references/deploy-vss-detection-tracking-2d.md) + [`references/teardown-flow.md`](references/teardown-flow.md) |
| `check rtvi-cv logs`, `diagnose rtvi-cv crashing`, `troubleshoot healthcheck failing`, `rtvi-cv won't start` | **DEBUG** | [`references/deploy-vss-detection-tracking-2d.md`](references/deploy-vss-detection-tracking-2d.md) + [`references/troubleshooting.md`](references/troubleshooting.md) |
| `add a stream`, `remove camera`, `list streams`, `health check`, `is rtvi-cv ready`, `get metrics`, `what's the FPS`, `check GPU usage`, `generate text embeddings`, `call rtvi-cv api` | **API USAGE** | [`references/usage-vss-detection-tracking-2d.md`](references/usage-vss-detection-tracking-2d.md) + [`references/api-reference.md`](references/api-reference.md) |

**Selection rule:** match the user's phrasing against the table above and immediately load the corresponding reference file. Do not mix the flows — DEPLOY assumes no running container yet; API USAGE assumes the container is already running on `http://<host>:9000`.

If intent is genuinely ambiguous (e.g., the user says just "I want to use rtvi-cv"), ask one `AskQuestion`: deploy a new instance, or call an already-running one?

---

## What lives where

```
vss-deploy-detection-tracking-2d/
├── SKILL.md          # this file (routing + contracts)
├── assets/           # data files (deploy-defaults.yml — single source of truth for tags / refs / paths / GPU)
├── evals/            # Tier-3 eval manifests (deploy-evals.json, usage-evals.json)
├── scripts/          # 23 bash + python helpers (see `scripts/` for the full inventory)
└── references/       # workflow runbooks (deploy / api-usage / teardown / troubleshooting / …)
```

For the full per-file inventory and what each reference covers, see
[`references/workflow-reference.md`](references/workflow-reference.md).

All scripts are invoked from the skill root via `$SKILL_DIR/scripts/<name>` — paths inside the deploy reference doc are preserved verbatim and resolve correctly when the agent runs from skill root.

---

## Available Scripts

Helpers live in `scripts/` and are invoked from the skill root by name —
call each via `run_script("scripts/<name>")` so the agent records a
proper tool invocation.

| Script | Purpose | Arguments |
| --- | --- | --- |
| `load_defaults.sh` | Detect platform (x86 dGPU / SBSA / Jetson) and resolve YAML defaults from `assets/deploy-defaults.yml`. | `--usecase <name>` |
| `fetch_resources.sh` | Download + extract NGC resources, scan for layout. | `--ngc-ref <ref>` (optional) |
| `apply_in_container.sh` | Host-side wrapper for Step 4 (`apply_config.sh` inside the running container). | `<container_name>` |
| `apply_config.sh` | In-container path-substitution, batch, sink, sources, engine cache. | `<usecase> <stream_count> <sink_type>` |
| `start_app_in_container.sh` | Host-side wrapper for Step 5 (`run_app_and_wait.sh`). | `<container_name>` |
| `run_app_and_wait.sh` | In-container app launch + readiness + metrics + log. | `<config_path>` |
| `add_streams.sh` / `update_stream_sources.sh` | REST stream lifecycle for Step 6. | `<rtsp_or_file_uri>...` |
| `collect_metrics.sh` | Pull `/api/v1/metrics` snapshot. | none |
| `discover_streams.sh` | Enumerate active streams via `/stream/get-stream-info`. | none |
| `synthesize_docker_run.sh` | Print the platform-correct `docker run` line for the resolved env. | none |
| `render_box.sh` | Render the fixed-width step receipt. | `<step_label>` |
| `calibration_manager.py` | Manage calibration artefacts + per-use-case engine cache invalidation. | `--usecase <name> --reset` |

For the full inventory of helpers (cache, GPU checks, setup) browse
`scripts/`; each script's `--help` describes its arguments.

## How to use this skill

1. **Read this file first.** It only routes — it does not contain workflows.
2. **Match the user's intent** against the routing table above.
3. **Load exactly one reference doc** (DEPLOY or API USAGE). Don't preload both — each reference is large and contains its own full contract.
4. **Follow the loaded reference exactly.** The reference docs are the byte-for-byte preserved contracts from the predecessor skills `vss-deploy-detection-tracking-2d` (deploy/teardown/debug) and `rtvicv-api` (REST API) — every step ordering invariant, bash-batching rule, box-rendering rule, and `AskQuestion` contract is retained.
5. **For DEPLOY**, the reference doc enforces its own startup contract: one-line acknowledgement → planning-tool call (`TodoWrite` array of 5 todos, OR 5 successive `TaskCreate` calls on newer Claude Code) → Step 1 question. Do not narrate, do not pre-flight, and never print "loading TodoWrite/TaskCreate" or any deferred-tool resolution prose — the planning tool is loaded silently.

---

## Output contract — DEPLOY flow

When running the DEPLOY / TEARDOWN / DEBUG flow, the agent MUST honour
all four items below on every successful deploy. These are the user's
only feedback channel between steps; skipping any of them is a
behaviour regression.

1. **Render every step's exit in a fixed-width box** — Step 1 *Deploy
   targets*, Step 2 *Pipeline configuration*, Step 3 *Container*, Step 4
   *Apply configuration*, Step 5 *Plan* + *Results*. Not just the final
   summary. The box is the user's step receipt. Geometry is fixed (see
   § "Universal box format" below). Per-step **content** rules (what
   rows go inside each box) live in [`references/deploy-vss-detection-tracking-2d.md`](references/deploy-vss-detection-tracking-2d.md)
   under "Step N box content rule".
2. **After the Step 5 Results box, issue the Step 6 `AskUserQuestion`**
   from [`references/next-steps.md`](references/next-steps.md) § "11.c"
   — never replace it with a free-form *Next steps* bullet list. The
   menu is the deploy's exit handle: it lets the user run metrics,
   manage streams, tail logs, or tear down with one click instead of
   having to remember curl URLs.
3. **After the user picks a Step 6 bucket, issue the follow-up
   `AskUserQuestion`** from [`references/next-steps.md`](references/next-steps.md)
   § "11.d" — never substitute prose + ready-to-copy curl examples + a
   free-text "want me to run X?" question. Each bucket has its own
   menu of concrete actions; the user picks the action, then the skill
   emits the API box and runs the curl. Per-bucket follow-ups:
   - **Manage streams** → Add / Remove / List. **Remove builds its
     options dynamically from `/stream/get-stream-info`** — one option
     per active stream labelled `<camera_id> · <camera_url>` plus
     "Remove ALL" when `ACTIVE > 1` (full spec: § "`remove_streams`
     sub-flow").
   - **Stop the deployment** → Stop app / Stop container / Full teardown.
   - **Check metrics & FPS** → no follow-up; run `collect_metrics.sh`
     directly after printing the `/api/v1/metrics` API box.
   - **Check liveness / readiness** → no follow-up; probe all three
     health endpoints after printing their API boxes.
4. **Render the FULL per-step content, not an overview row** —
   rendering the box is necessary but not sufficient. Each step has a
   row composition spec in
   [`references/deploy-vss-detection-tracking-2d.md`](references/deploy-vss-detection-tracking-2d.md)
   under "Step N box content rule". **Step 4 (Apply configuration) is
   where the agent collapses most often** — its canonical
   per-use-case key list lives in
   [`references/apply-config.md`](references/apply-config.md)
   § "Per-use-case complete edit list", and the agent MUST emit one
   `✔ [section] key=value  — annotation` row per key in that table for
   the active use case + settings. A section with 5 keys → 5 rows; a
   section with 6 keys → 6 rows. Never one overview row per section.

Forbidden (these are the shortcuts the agent falls back to under
pressure, and they break the user's UX):

- ❌ **Internal tool-loading narration.** Never print "I need to load
  TodoWrite (a deferred tool the skill calls for the task widget)",
  "Loading TaskCreate…", "Calling ToolSearch for the planning tool…",
  or any other text about resolving / loading / fetching deferred tools.
  The agent loads tools **silently**. The user only ever sees the `✔
  <pinned-values>` summary line followed by the widget — never any
  scaffolding around tool resolution.
- ❌ **Collapsing all 5 deploy steps into a single `TaskCreate`'s
  `description` field.** When `TaskCreate` is the available planning
  tool, issue **5 separate `TaskCreate` calls** back-to-back (one per
  step). See `references/task-list.md` § "Initial `TaskCreate` calls"
  for the verbatim template. Same rule for `TodoWrite` — one call with
  all 5 todos in the `todos:[…]` array; never one todo whose `content`
  is a multi-line list.
- ❌ **Silently choosing `dynamic` stream-mode.** The skill default is
  `stream_mode=static` — the agent bakes auto-discovered `file://` URLs
  into the DS main config's `[source-list]` block before app start.
  Switch to `dynamic` only when the user explicitly asks ("add streams
  later via REST", "use dynamic stream mode") OR when they pick `dynamic`
  in the Step 2 AskQuestion. Picking `dynamic` for a generic "deploy
  rtvi-cv with N streams" query breaks the deploy rubric and the
  user's `/metrics` expectations. See
  [`references/pipeline-config.md`](references/pipeline-config.md)
  § "Defaults — the skill is static-mode by default" for the full
  rationale.
- ❌ A one-line `✔ App ready in Ns, N streams, fps total Y` in place of
  the Step 5 Results box.
- ❌ ASCII box-drawing chars (`+`, `-`, `=`, `*`) instead of light
  box-drawing chars (`┌ ─ ┐ │ └ ┘`).
- ❌ Skipping Step 6 on the assumption "the user knows what to do next".
- ❌ After Step 6, dumping a markdown wall of prose + multiple curl
  blocks + a closing "want me to run any of these?" — that's the
  shape the agent falls back to and it bypasses both the 11.d menu
  and the per-API-call box. The user picks from a menu; the skill
  shows the resolved API box; the skill runs it. No free-text Q.
- ❌ Step 4 overview collapses — these are explicitly banned by the
  deploy doc's Step 4 content rule:
    - `✔ Batch size 3 (tile grid: 1×3)` → required: 5 separate rows
      (`[streammux] batch-size=3`, `[primary-gie] batch-size=3`,
      `[source-list] max-batch-size=3`, `[tiled-display] rows=1`,
      `[tiled-display] columns=3`).
    - `✔ Output sink eglsink` → required: one row per sink key
      (4 keys for eglsink, e.g. `[sink0] enable=1`, `type=2`,
      `sync=0`, `qos=0` — read apply-config.md for the exact list).
    - `✔ Sources static (3 streams, http-port=9000)` → required: six
      annotated `[source-list]` rows.
    - `✔ Tile grid 1 row × 3 cols` (single row) → required: two
      rows, `[tiled-display] rows=1` and `[tiled-display] columns=3`.

## Universal box format

The geometry contract for every step-exit box (Step 1 through Step 5
Results). The same shape across every box; only the **title** and the
**body rows** change per step.

- **Width: 128 chars** corner-to-corner — `┌` at column 1, `┐` at
  column 128. Wider terminals leave the box flush-left; do not stretch
  it. Inner content area is **124 chars** (with one space margin on
  each side inside the `│` borders).
- **Light box-drawing chars only**: `┌ ─ ┐ │ └ ┘`. No `+`, `-`, `=`,
  `*` ASCII fallbacks.
- **Top border — title CENTERED**: `┌` + N₁ dashes + `␣` + title + `␣`
  + N₂ dashes + `┐`, where `N₁ + N₂ + len(title) + 2 = 126`. Distribute
  the pad: `N₁ = floor((126 − len(title) − 2) / 2)`,
  `N₂ = 126 − len(title) − 2 − N₁`. N₁ and N₂ differ by at most 1.
- **Body**: one `│ <content padded to inner-content 124> │` per fact.
  Each fact line uses the `  ✔ <key-padded-to-13>  <value>` form (two
  spaces in, glyph, key right-padded to 13, two spaces, value).
- **Blank lines between groups**: render `│ <124 spaces> │` between
  logical groups (e.g. Identity / Model / Videos in Step 1) so the
  user can scan the box at a glance.
- **Bottom border**: `└` + 126 dashes + `┘` — solid border, no title.

Standard step titles (used at the top of each step's box):

```
┌─────────────────────────────────────────────────────── Deploy targets ───────────────────────────────────────────────────────┐
┌─────────────────────────────────────────────────── Pipeline configuration ───────────────────────────────────────────────────┐
┌───────────────────────────────────────────────────────── Container ──────────────────────────────────────────────────────────┐
┌──────────────────────────────────────────────────── Apply configuration ─────────────────────────────────────────────────────┐
┌──────────────────────────────────────────────── Perception Application — Plan ───────────────────────────────────────────────┐
┌────────────────────────────────────────────── Perception Application — Results ──────────────────────────────────────────────┐
```

Per-step content rules (which rows go in which box, mode-aware row
hiding, the apply-config sectioned layout, the Step 5 PLAN-then-RESULT
pattern, the Step 3 `docker run` synthesis requirement) live in
[`references/deploy-vss-detection-tracking-2d.md`](references/deploy-vss-detection-tracking-2d.md)
under "Step N box content rule" — read those when rendering the
corresponding step.

## Quick triggers (mnemonic)

| Phrase | Flow |
|--------|------|
| `deploy rtvicv warehouse 2d with 4 streams and display` | DEPLOY |
| `run smartcity gdino on gpu 1` | DEPLOY |
| `stop the perception container` | TEARDOWN (deploy doc) |
| `rtvi-cv healthcheck failing` | DEBUG (deploy doc + troubleshooting) |
| `add a stream to rtvi-cv` | API USAGE |
| `is rtvi-cv ready on localhost:9000` | API USAGE |
| `get rtvi-cv metrics` | API USAGE |
| `generate text embeddings via rtvi-cv` | API USAGE |

bump:1

所有檔案

51 個檔案

安裝 vss-deploy-detection-tracking-2d

請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。

下載 ZIP

複製儲存庫並將技能檔案複製到您的專案中。

git clone https://github.com/NVIDIA/skills/tree/main/skills/vss-deploy-detection-tracking-2d # Copy SKILL.md to your .claude/skills/ directory

複製 複製
快速設定: 將技能資料夾複製到 .claude/skills/ Claude 會自動偵測並使用該技能
儲存庫 NVIDIA/skills

相關技能

klingai-upgrade-migration
更新時間 2026-07-03
Verification &amp; Quality Assurance
更新時間 2026-06-29
base44-cli
更新時間 2026-06-29
Railway CLI Management
更新時間 2026-07-02
OR