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 automation: ONNX download, SafeTensors export, TRT engine build, custom nvinfer bbox parser, multi-stream benchmark, and PDF report.
Install / Use
npx skills add NVIDIA/skills --skill deepstream-import-vision-modelInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Our assessment of deepstream-import-vision-model
deepstream-import-vision-model scores 95/100 on our quality scale, 287th of 2,125 Automation skills we index (top 14%).
Its SKILL.md is 14 KB long, well organised into 21 sections with 9 code examples: a thorough specification that gives an agent plenty to work with.
With 3,421 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 5 days ago, so deepstream-import-vision-model is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-29. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
deepstream-import-vision-model compared with similar skills
All 4 of these similar skills score higher than deepstream-import-vision-model; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| deepstream-import-vision-model (this skill)by NVIDIA | 95 | 3.4k | 5d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 86.0k | 13d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 73.4k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 84.4k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 6d ago | SKILL.md |
Frequently asked questions
- How do I install deepstream-import-vision-model?
- Run
npx skills add NVIDIA/skills --skill deepstream-import-vision-model. The install tabs above show the steps for each supported agent. - Which AI agents does deepstream-import-vision-model work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is deepstream-import-vision-model safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is deepstream-import-vision-model still maintained?
- The repository was last updated 5 days ago, so deepstream-import-vision-model is actively maintained.
Skill content
View source on GitHubname: 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: author: "Tushar Khinvasara tkhinvasara@nvidia.com" owner: "Tushar Khinvasara tkhinvasara@nvidia.com" service: "deepstream" version: "1.5.2" reviewed: "2026-08-04" team: deepstream-sdk tags: - deepstream - tensorrt - object-detection - import-vision-model languages: - bash - python - cpp domain: computer-vision
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:
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 | Browse HF/NGC, detect format, download ONNX or export SafeTensors | | 4–5 | Engine Build | references/engine-build.md | Build dynamic TRT engine, run trtexec BS=1 and BS=MAX_BS | | 6–7 | DS Pipeline | references/pipeline-run.md | Custom bbox parser, nvinfer config, single-stream + multi-stream benchmarks | | 8 | Report | 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. 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:
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):
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).
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
mkdir -p models/$MODEL_NAME/{model,parser,config,scripts,benchmarks/engines,benchmarks/ds,reports/charts,samples/kitti_output}
Critical Rules
- Engine naming — always
{model}_dynamic_b{MAX_BS}.engine. Never baremodel_dynamic.engine. - batch_size == num_streams — in DS runs,
batch-sizeand stream count are always equal. - 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. - Parser zero-init — always
NvDsInferObjectDetectionInfo obj = {};. Required for DS 9.1 OBB support; bareobj;leavesrotation_angleuninitialized, causing tilted bounding boxes. - KITTI validation gate — do NOT proceed to Step 7 if KITTI frame count is zero or detection rate < 90%.
- Shared venv —
build/.venv_optimumreused across all models. Never create per-model venvs. - trtexec
--noDataTransfers— GPU-only compute matches DeepStream's GPU-to-GPU data flow. - Report HTML+PDF — always use
.claude/skills/deepstream-import-vision-model/scripts/report/md-to-html-pdf.py. Never write a custom HTML generator or callwkhtmltopdfdirectly. - Object detection only — reject non-detection architectures from
config.jsonbefore building anything. - Encoder fallback (MANDATORY) —
x264encandopenh264encare prohibited. On NVENC-unavailable systems, usetheoraenc + oggmux(LGPL; ships in gst-plugins-base; output is.ogv). Iftheoraenc/oggmuxare absent, skip video creation (DS_SINGLE_STREAM_MODE=skipped). Report which mode was used:nvv4l2h264enc/theoraenc-fallback/skipped. - Video source (MANDATORY) — default is always
sample_720p.mp4(1280×720). Never autonomously substitutesample_1080p_h264.mp4or any other file. Only use a different video when the user explicitly provides a path (viaDS_VIDEOenv var or script argument).
Examples
Default model, end to end. Bootstrap once, then run the full pipeline:
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
# then: "Use deepstream-import-vision-model to run PekingU/rtdetr_r50vd"
SafeTensors model with no published ONNX. Step 2b exports it first; the wrapper reports which backend produced the graph and fails loudly if the batch dimension was baked in:
bash .claude/skills/deepstream-import-vision-model/scripts/model/safetensors-to-onnx.sh \
models/$MODEL_NAME/hf_model models/$MODEL_NAME/onnx_export/
# [export] backend=dynamo
# [export] dynamo produced a static batch dimension; trying the next backend
# [export] backend=legacy-torchscript
# [export] pixel_values shape=['batch', 3, 640, 640]
Pin a Hub revision for a reproducible build — any exporter flag passes straight through:
bash .claude/skills/deepstream-import-vision-model/scripts/model/safetensors-to-onnx.sh \
PekingU/rtdetr_r50vd models/rtdetr/onnx_export --revision <commit-sha> --opset 18
Pipeline Timing
Wrap every step:
STEP_START=$(date +%s.%N)
# ... step commands ...
STEP_END=$(date +%s.%N)
STEP_DURATION=$(python3 -c "print(round($STEP_END - $STEP_START, 2))") # bc is not in the container; python3 always is
echo "[Step N] completed in ${STEP_DURATION}s"
Track PIPELINE_START (before Step 1) and PIPELINE_END (after Step 8). Report all durations in the benchmark report.
Report Output (MANDATORY — all 3 formats)
benchmark_report.md— markdown source (12 mandatory sections)benchmark_report.html— styled HTML (charts base64-inlined, no local file access)benchmark_report_{model_name}.pdf— viamd-to-html-pdf.py; verify charts are embedded by countingdata:image/pngoccurrences in the HTML output:grep -o 'data:image/png' benchmark_report.html | wc -lshould equal 5
Run charts and report scripts with the shared venv active: source build/.venv_optimum/bin/activate.
Reference Documents
IMPORTANT: Read the relevant reference before starting each phase. Do NOT generate code from memory.
| Document | Use When | |----------|----------| | references/model-acquire.md | Steps 1–3: HF/NGC URL parsing, format detection, ONNX download, SafeTensors export, label extraction | | references/engine-build.md | Steps 4–5: trtexec engine build, benchmarks, PEAK_GPU_STREAMS derivation, iterative scaling | | references/pipeline-run.md | Steps 6–7: custom bbox parser, nvinfer config, single-stream validation, KITTI dump, multi-stream benchmark | | references/report-generation.md | Step 8: benchmark_data.json, 5 charts, 12-section markdown report, HTML + PDF |
Scripts
Installed into .claude/skills/deepstream-import-vision-model/scripts/ by install.sh.
| Script | Phase | Purpose |
|--------|-------|---------|
| model/hf-list-files.sh | 1–3 | List HuggingFace repo files |
| model/hf-download-config.sh | 1–3 | Download config.json from HF |
| model/ngc-list-files.sh | 1–3 | List NGC model files |
| model/ngc-download.sh | 1–3 | Download NGC model archive |
| model/safetensors-to-onnx.sh | 1–3 | Export SafeTensors → ONNX via torch.onnx.export (wrapper) |
| model/safetensors_to_onnx.py | 1–3 | The exporter — dynamo backend, TorchScript fallback, verifies dynamic batch |
| model/inspect-onnx.py | 1–5 | Inspect ONNX input/output shapes |
| model/make-static-batch-onnx.py | 4–5 | Bake batch dim into ONNX |
| model/cleanup.sh | Any | Remove staging dirs, preserve shared venv |
| engine/benchmark-trtexec.sh | 4–5 | Run trtexec with s
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
86.0kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
73.4k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Scrapling
84.4k🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
