deepstream-import-vision-model

Import object detection models from HuggingFace or NGC into NVIDIA DeepStream with automated TensorRT engine builds and benchmarks.

2|Updated Aug 20, 2026
One-click install
npx skills add https://github.com/atomicrajat/industry_safety_monitoring_system --skill deepstream-import-vision-model-atomicrajat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deepstream-import-vision-model
Source: https://github.com/atomicrajat/industry_safety_monitoring_system/tree/main/.claude/skills/deepstream-import-vision-model
Command: npx skills add https://github.com/atomicrajat/industry_safety_monitoring_system --skill deepstream-import-vision-model-atomicrajat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires optimum, torch, transformers, onnxruntime, matplotlib, numpy, markdown, and includes scripts (resource) and references (resource) components.

What problem does it solve? Bringing a vision model from HuggingFace or NVIDIA NGC into a DeepStream pipeline involves many error-prone manual steps: downloading or exporting ONNX, building TensorRT engines, writing a custom nvinfer bounding-box parser, validating detections, and benchmarking multi-stream throughput. This Skill automates that entire workflow end to end. ## Core Features & Use Cases - Model Acquisition: Parses HuggingFace or NGC URLs, detects model format, downloads ONNX directly or exports SafeTensors to ONNX via optimum-cli, and extracts labels from config.json. - Engine Build & Benchmark: Builds dynamic-batch TensorRT engines with trtexec, derives PEAK_GPU_STREAMS, and iteratively scales batch size until GPU throughput is saturated. - DeepStream Integration: Generates a custom C++ bbox parser, nvinfer config, runs single-stream visual validation with a KITTI detection gate, and executes two-run multi-stream benchmarks. - Reporting: Produces benchmark reports in Markdown, HTML, and PDF with five charts. - Use Case: An engineer needs to deploy a YOLO or RT-DETR detector on a Jetson or dGPU box. Provide the HuggingFace model URL and receive a validated DeepStream pipeline plus a PDF benchmark report showing real-time stream capacity. ## Quick Start Import the HuggingFace model onnx-community/yolov8n into DeepStream and generate the full benchmark report.

Frequently Asked Questions about deepstream-import-vision-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import a HuggingFace model into NVIDIA DeepStream?

Provide the HuggingFace model URL or ID and the pipeline downloads or exports the ONNX model, builds a TensorRT engine, generates a custom nvinfer bbox parser, validates detections with a KITTI dump, and runs multi-stream benchmarks with a PDF report.

How do I convert SafeTensors models to ONNX for TensorRT?

When a repo has only SafeTensors or PyTorch weights, the skill exports to ONNX using optimum-cli in a shared virtual environment, with up to three retries and a manual torch.onnx.export fallback. The exported ONNX is validated before engine building.

Does this workflow support classification or segmentation models?

No. Only object detection architectures are supported. The pipeline inspects config.json and fails fast on architectures such as ForImageClassification, ForSemanticSegmentation, or ForCausalLM before building anything.

Why does my DeepStream pipeline show zero detections after import?

The most common cause is a wrong net-scale-factor in the nvinfer config, followed by parser output format mismatches. The KITTI validation gate stops the pipeline when zero detection files are written or the detection rate falls below 90 percent.

Can I build a TensorRT engine in Docker and run it on the host?

No. TensorRT engines are not portable across TensorRT versions, and Docker-built engines can silently fail when loaded by host DeepStream. Always build engines on the host using the same libnvinfer version as the DeepStream runtime.

What video encoder is used when NVENC is unavailable?

The primary encoder is nvv4l2h264enc producing MP4 output. When NVENC is unavailable, the approved fallback is theoraenc with oggmux producing OGV output; x264enc and openh264enc are prohibited, and video creation is skipped if neither path exists.