Skip to content
Agentmart
Submit a tool

deepstream-import-vision-model

Use this skill to bring a supported object-detection vision model from HuggingFace or NVIDIA NGC into an NVIDIA DeepStream pipeline with end-to-end…

Skill by Tushar Khinvasara <tkhinvasara@nvidia.com>

IndexedCC-BY-4.0 AND Apache-2.0★ 3,718
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/nvidia-deepstream-import-vision-model

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use this skill to bring a supported object-detection vision model from HuggingFace or NVIDIA NGC into an NVIDIA DeepStream pipeline with end-to-end automation: ONNX download, SafeTensors export, TRT engine build, custom nvinfer bbox parser, multi-stream benchmark, and PDF report. Object detection models only.

Use cases: documents, data, ml, model-inference

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/deepstream-import-vision-model

What's inside

Skill name
deepstream-import-vision-model
Description
Use this skill to bring a supported object-detection vision model from HuggingFace or NVIDIA NGC into an NVIDIA DeepStream pipeline with end-to-end automation: ONNX download, SafeTensors export, TRT engine build, custom nvinfer bbox parser, multi-stream benchmark, and PDF report. Object detection models only.
License
CC-BY-4.0 AND Apache-2.0
Metadata
team: deepstream-sdk · owner: Tushar Khinvasara <tkhinvasara@nvidia.com> · author: Tushar Khinvasara <tkhinvasara@nvidia.com> · domain: computer-vision · service: deepstream · version: 1.5.2 · reviewed: 2026-08-04
Instructions
234 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (56)

  • .gitattributes
  • .gitignore
  • BENCHMARK.md
  • CHANGELOG.md
  • README.md
  • SKILL.md
  • openai.yaml · agents/
  • evals.json · evals/
  • install.ps1
  • install.sh
  • README.md · references/
  • engine-build.md · references/
  • model-acquire.md · references/
  • pipeline-run.md · references/
  • report-generation.md · references/
  • windows.md · references/
  • benchmark-ds.sh · scripts/deepstream/
  • ds-kitti-dump.sh · scripts/deepstream/
  • ds-perf-run.sh · scripts/deepstream/
  • ds-single-stream.sh · scripts/deepstream/
  • ds-sweep.sh · scripts/deepstream/
  • extract-frame.sh · scripts/deepstream/
  • dsrun.sh · scripts/
  • benchmark-trtexec.sh · scripts/engine/
  • cleanup.sh · scripts/model/
  • config-to-labels.py · scripts/model/
  • hf-download-config.sh · scripts/model/
  • hf-list-files.sh · scripts/model/
  • inspect-onnx.py · scripts/model/
  • make-static-batch-onnx.py · scripts/model/
  • ngc-download.sh · scripts/model/
  • ngc-list-files.sh · scripts/model/
  • resolve-engine.sh · scripts/model/
  • safetensors-to-onnx.sh · scripts/model/
  • safetensors_to_onnx.py · scripts/model/
  • preflight.sh · scripts/
  • generate-benchmark-charts.py · scripts/report/
  • latex-pdf-wrap.tex · scripts/report/
  • md-to-html-pdf.py · scripts/report/
  • md-to-pdf.sh · scripts/report/
  • mermaid-puppeteer-root.json · scripts/report/
  • mermaid-puppeteer.json · scripts/report/
  • pandoc-wrap-tables.lua · scripts/report/
  • render-mermaid-for-pdf.py · scripts/report/
  • report-style.css · scripts/report/
  • requirements.txt · scripts/
  • setup.sh
  • skill-card.md
  • skill.oms.sig
  • README.md · tests/
  • __init__.py · tests/
  • test_evals_contract.py · tests/
  • test_hardened_scripts.py · tests/
  • test_onnx_export_contract.py · tests/
  • test_powershell_installer.py · tests/
  • test_skill_model_intake.py · tests/

SKILL.md (first lines)

# DeepStream Import Vision Model

When this skill is active, **read the relevant reference document before starting each phase**. Do not rely on memory — reference documents contain exact script paths, bash variable conventions, log filename contracts, and critical parsing rules.

**Current scope:** Object detection models only. Fail fast on classification, segmentation, or other architectures detected in `config.json`.

## Model choice — always offer two options

Before preflight, browsing, downloads, or file creation, present exactly these two choices. Do not
start with only an open-ended model-source prompt. If the user's request already clearly selects a
model, confirm the matching choice instead of asking redundantly.

### 1. Default model (recommended)

Use the validated Hugging Face RT-DETR model:

```yaml
model_id: PekingU/rtdetr_r50vd
source: huggingface
task: object-detection
precision_preference: fp16
```

### 2. Custom object-detection model

Ask for one supported source:

- Hugging Face model ID (`organization/model`) or full model URL.
- NVIDIA NGC catalog model URL including its version.

Explain that the skill currently rejects classification, segmentation, and other non-detection
architectures after inspecting `config.json`. Do not invent or silently substitute a model when the
custom source is missing or unsupported.

For a dry run, present the same two choices and simulate discovery, build, benchmark, and report
stages without browsing, downloading, launching Docker, writing files, or starting processes.

## Pipeline Overview

| Step | Phase | Reference | What it does |
|------|-------|-----------|--------------|
| 1–3 | Model Acquire | [references/model-acquire.md](references/model-acquire.md) | Browse HF/NGC, detect format, download ONNX or export SafeTensors |
| 4–5 | Engine Build  | [references/engine-build.md](references/engine-build.md) | Build dynamic TRT engine, run trtexec BS=1 and BS=MAX_BS |
| 6–7 | DS Pipeline   | [references/pipeline-run.md](references/pipeline-run.md) | Custom bbox parser, nvinfer config, single-stream + multi-stream benchmarks |
| 8   | Report        | [references/report-generation.md](references/report-generation.md) | 5 charts, HTML, PDF benchmark report |

Run the full pipeline autonomously without pausing for confirmation at each step.

## Runs entirely through Docker (no host packages)

**Every step runs INSIDE the DeepStream container.** The host needs only **Docker + the NVIDIA
driver** — no host python/venv/torch/trtexec/make/wkhtmltopdf. This works identically on Linux and
**Windows** (Docker Desktop + WSL2 backend, required for `--gpus`). The per-shell bind-mount
token is the only OS difference — `-v "$PWD":/work` (bash), `-v "${PWD}:/work"` (PowerShell),
`-v "%cd%:/work"` (cmd); full guide in [references/windows.md](references/windows.md). All venv/ONNX/
engine/parser/config/report artifacts live under the mounted working root and persist between the
ephemeral `--rm` containers.

## Pre-flight — bootstrap + verify (through the container)

**1. One-time bootstrap** — builds `build/.venv_optimum` (torch/onnx/onnxruntime/report deps; the
venv name is historical, optimum is no longer used) +
installs `wkhtmltopdf`, all in-container. From the working root:
```bash
docker run --rm -it --gpus all --shm-size=16g -v "$PWD":/work -w /work \
  --entrypoint bash nvcr.io/nvidia/deepstream:9.1-triton-multiarch \
  .claude/skills/deepstream-import-vision-model/setup.sh
```

**2. Preflight** — GPU + venv + trtexec, run THROUGH the container (container-mode auto-detects):
```bash
docker run --rm --gpus all -v "$PWD":/work -w /work \
  --entrypoint bash nvcr.io/nvidia/deepstream:9.1-triton-multiarch \
  .claude/skills/deepstream-import-vision-model/scripts/preflight.sh   # proceed only on PASS
```

**Every subsequent phase runs the same way** — issue the model's commands via
`docker run … --entrypoint bash … -lc '<commands>'` (or the
`.claude/skills/deepstream-import-vision-model/scripts/dsrun.sh` wrapper:
`bash .claude/skills/deepstream-import-vision-model/scripts/dsrun.sh '<in-container command>'`),
using `PY=build/.venv_optimum/bin/python` and
`trtexec` at `/usr/src/tensorrt/bin/trtexec` inside the container. `deepstream-app`,
`gst-launch-1.0`, and `/opt/nvidia/deepstream/…` sample paths all exist **in** the image.
TensorRT build+runtime share one image, so there is **no version skew** (the concern the old
"build on the host" rule tried to avoid — see [references/engine-build.md](references/engine-build.md)).
`sample_720p.mp4` ships in the image; set `DS_VIDEO` only to override.

## Mandatory Output Structure

Create once `MODEL_NAME` is known (Step 1). Never dump files flat.

```
models/{model_name}/
  model/           <- ONNX file(s)
  parser/          <- .cpp, Makefile, .so
  config/          <- nvinfer config, ds-app config, labels.txt
  scripts/         <- run helper scripts
  benchmarks/
    engines/       <- _dynamic_b{MAX_BS}.engine, timing.cache, build logs
    b1/            <- trtexec BS=1 log
    b{MAX_BS}/     <- trtexec BS=MAX_BS log
    ds/            <- DS benchmark logs
  reports/         <- benchmark_report.md, .html, .pdf, benchmark_data.json
    charts/        <- chart_*.png (5 charts)
  samples/         <- output .mp4 or .ogv (theoraenc fallback), test frames
    kitti_output/  <- KITTI detection .txt files
```

```bash
mkdir -p models/$MODEL_NAME/{model,parser,config,scripts,benchmarks/engines,benchmarks/ds,reports/charts,samples/kitti_output}
```

## Critical Rules

1. **Engine naming** — always `{model}_dynamic_b{MAX_BS}.engine`. Never bare `model_dynamic.engine`.
2. **batch_size == num_streams** — in DS runs, `batch-size` and stream count are always equal.
3. **Log filenames are fixed** — `trtexec_b1.log`, `trtexec_b${MAX_BS}.log`, `ds_s${N}_run1.log`, `ds_s${N}_run2.log`. No timestamps. Report generation reads exact paths.
4. **Parser zero-init** — always `NvDsInferObjectDetectionInfo obj = {};`. Required for DS 9.1 OBB support; bare `obj;` leaves `rotation_angle` uninitialized, causing tilted bounding boxes.
5. **KITTI validation gate** — do NOT proceed to Step 7 if KITTI frame count is zero or detection rate < 90%.

From NVIDIA/skills, CC-BY-4.0 AND Apache-2.0.

More from NVIDIA/skills

Compare and alternatives

    Featured in

    Signals

    Stars
    3,718
    Forks
    457
    Open issues
    8
    Last commit (this folder)
    Sep 4, 2026 (1 month ago)

    From GitHub (fetched Oct 24, 2026).

    Details

    Version
    1.5.2
    License
    CC-BY-4.0 AND Apache-2.0
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026
    Cite this page

    deepstream-import-vision-model skill. Agent Mart. https://agentmart.dev/skills/nvidia-deepstream-import-vision-model (last updated 2026-10-24)