Deepstream Sop 标志

Deepstream Sop

组织热门
NVIDIA
deepstream-sop

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the user does not name it: verify operator step sequence, detect missing or out-of-order SOP steps, score factory/work-cell video for procedure compliance, run VLM-based SOP checking on industrial cameras, or call /v1/chat/completions with a file, RTSP, or Basler camera. Also trigger for its internals: SOPVideoProcessor, DeepStream GEBD model (e.g. DDM) via Triton CAPI, nvds_custom_postprocess, Cosmos Reason 1/2 vLLM, SSE streaming, Kafka NvProto/JSON output, Basler/Pylon camera + emulation, Docker compose, chunk-level latency. Do NOT trigger for generic DeepStream pipelines, object detection/tracking, NIM imports, or video summarization.

概览

发布者NVIDIA
代码仓库skills
技能名称deepstream-sop
星标数
3.3K
复刻数
397
附带文件
56
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 56 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 NVIDIA 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Deepstream Sop AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/NVIDIA/skills/tree/main/skills/deepstream-sop
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NVIDIA/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/deepstream-sop .claude/skills/deepstream-sop
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Deepstream Sop,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Deepstream Sop。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Deepstream Sop 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

DeepStream SOP Inference Microservice Skill

This skill guides AI coding assistants in building, extending, and debugging the NVIDIA DeepStream SOP (Standard Operating Procedure) Inference Microservice — a GPU-accelerated pipeline for temporal action detection and VLM-based SOP compliance monitoring on industrial video feeds.

Reference repository: https://github.com/NVIDIA/sop-monitoring-blueprints/tree/main/microservices/sop-inference-bp Local reference code: sop-inference-bp/ directory (from a local clone of the repository)


Models

Model-agnostic at both inference stages — swap via env var (and Triton dir for GEBD).

StageRoleModel classDefaultSwap via
Stage 1 (CV)Per-frame boundary scoring → chunk segmentationGeneric Event Boundary Detection (GEBD)DDM (MCG-NJU/DDM) via Triton Python backendReplace triton_model_repo/<model>/ + DDM_MODEL_PATH (§ 5)
Stage 3 (VLM)Per-chunk action classificationVision-language model via vLLMCosmos Reason 1 7B (Reason 2 also supported)Set VLLM_MODEL_PATH to a different HF ID or local path

"GEBD" = swappable Stage-1 slot; "DDM" = the default architecture (terms used interchangeably).

Chunking is selectable per request (§ 2): default ddm-net uses GEBD; uniform produces fixed-length chunks and bypasses Stage-1 GEBD (§ 3, § 6). DDM temporal window is configurable via FRAMES_PER_SIDE / SEQUENCE_BATCH (§ 4, § 5), with optional TensorRT (§ 5).


Architecture Overview

Runs in a Docker container (nvds-action-sop) alongside a Kafka container. Full diagram: references/sop_architecture.svg.

Data flow through the 4-stage SOPVideoProcessor pipeline (per-request):

Input Sources                    Docker Container: nvds-action-sop
─────────────                    ──────────────────────────────────────────────────
Video Files ──┐                  FastAPI Server (port 8300)
RTSP Streams ─┤── base64/       ├─ /v1/chat/completions → SOPProcessManager
Basler Camera ┘   file/rtsp/       │
                  camera           │ ModelInitializer: VLM first, then DDM dummy pipeline
                                   │ 4 Thread Pools: cv(32), clip(32), vlm(64), vlm_req(64)
                                   │
                                   ▼ SOPVideoProcessor (per-request)
                                   ┌────────────────────────────────────────────────┐
                                   │ Stage 1: DeepStream Pipeline (GPU)             │
                                   │   Source → nvstreammux → tee1                  │
                                   │    ├─[inference] queue1 → nvdspreprocess       │
                                   │    │  → nvinferserver (Triton CAPI + DDM)      │
                                   │    │  → InferOutputTensorParser → score_queue  │
                                   │    ├─[frames]  queue3 → nvvideoconvert         │
                                   │    │  → capsfilter → appsink                   │
                                   │    │  → DecodedFrameRetriever → frame_queue    │
                                   │    └─[RTSP out] queue → convert → H.264 enc    │  (optional, § 18)
                                   │       → rtppay → udpsink → RTSPServer (§ 18)   │  opt-in only
                                   │              │ boundary scores                 │
                                   │              ▼                                 │
                                   │ Stage 2: Clip Post-Process                     │
                                   │   Boundary detection → chunk segmentation      │
                                   │              │ video frames + timestamps        │
                                   │              ▼                                 │
                                   │ Stage 3: VLM Inference                         │
                                   │   Embedded vLLM (Cosmos Reason 1/2)            │
                                   │   Frame sampling at VLM_FPS → classification   │
                                   │              │ action labels                    │
                                   │              ▼                                 │
                                   │ Stage 4: SOP Checker                           │
                                   │   Sequence validation → missing/misordered     │
                                   │              │ chunk results                    │
                                   │              ▼                                 │
                                   │         final_queue                            │
                                   └────────────────────────────────────────────────┘
                                          │
Output                                    ▼
──────                             ┌─────────────────┐
SSE Stream (chat.completion.chunk) │ Kafka Messages   │
Non-streaming (chat.completion)    │ (JSON/Protobuf)  │
Prometheus metrics (/v1/metrics)   └────────┬────────┘
                                            ▼
                                   Docker Container: kafka
                                   (apache/kafka:3.7.0)

Section Index

Each section is a standalone file in references/ — load only what your task needs.

§FileResponsibility
1skill_01_fastapi_endpoints.mdFastAPI endpoints, server init, Prometheus metrics
2skill_02_pydantic_schemas.mdRequest/response Pydantic models (api_types.py)
3skill_03_deepstream_pipeline.mdDeepStream pyservicemaker pipeline, tensor parser, dummy pipeline
4skill_04_config_templates.mdnvdspreprocess / nvinferserver config templates + rendering
5skill_05_triton_ddm_model.mdTriton model repo, config.pbtxt, model.py, ddm_net.py
5bskill_05b_custom_postprocess.mdC++ postprocess plugin, Makefile, IOptions API
6skill_06_sop_process_manager.mdSOPProcessManager, SOPVideoProcessor, VLLMInference, Kafka
6bskill_06b_sop_checker.mdSOP sequence and checker compliance: MissingNumberDetector, SopCheckerCache, SopCheckerRequest/Response
7skill_07_sse_streaming.mdSSE generator, stream response formatting, dummy test mode
8skill_08_basler_camera.mdBasler camera support, Pylon SDK, emulation, formats
9skill_09_docker_build_deploy.mdDocker build, deploy, .env configuration
10skill_10_test_suite.mdTest suite coverage, assertions, running tests
11skill_11_env_variables.mdAll environment variables reference
12skill_12_evaluation_workflow.mdEnd-to-end eval workflow: static checks, build, launch, tests, API/camera/Kafka checks, report
13skill_13_verification_curl.mdVerification steps and curl examples
14skill_14_implementation_checklist.mdImplementation checklist: file copy list, generated files, Docker prereqs, verification
15skill_15_latency_measurement.mdTTFC and C2C latency measurement for file input via SSE streaming
16skill_16_message_schema.mdKafka message schema selection (JSON default vs NvProtoSchema) and extending messages with custom data
17skill_17_camera_latency_measurement.mdCamera / live-stream chunk_e2e latency measurement using internal pipeline timestamps
18skill_18_rtsp_streaming_output.mdOPT-IN RTSP streaming output: tee1-tap re-stream, RTSPStreamingServer, SW_ENCODER toggle. Generate only when user explicitly requests RTSP

For end-to-end evaluation, read § 12 first; load build/test/curl/latency/camera/Kafka as needed.

§ 18 is opt-in — generate only when the user explicitly requests RTSP output; otherwise skip § 18 and the RTSP_* rules below.


Key Files Map

The full source-to-target file mapping lives in skill_14_implementation_checklist.md:

  • Files copied verbatim from references/ (non-trivial algorithms — cycle detection, qwen_vl_utils preprocessing, DeepStream IOptions API, protobuf sources) with the rationale per file.
  • Files copied as adaptable templates (Dockerfile, compose.yaml, Triton config and model.py, ddm_net.py, Pylon emulation config, etc.).
  • Files generated from skill sections — each annotated with the Critical Rules below that the generation must follow exactly.
  • Docker build prerequisites and post-build verification checklist.

Config files (nvds_preprocess_template.txt, nvds_inference_template.txt, vlm_prompts.txt) are used as-is from configs/.

When skill_06b is loaded, read configs/actions.json from the project root and run the § 6b-G generation workflow to produce nvds_action_detector/missing_number_detector.py. If configs/actions.json is absent or invalid, fall back to copying the reference file.


Critical Rules

Each rule's full detail lives in the linked skill_NN_*.md reference file.

TagRule summaryDetails in
MANAGER_INIT_IN_MAINSOPProcessManager init in main() before uvicorn.run() — not inside lifespan()skill_01_fastapi_endpoints.md
NAMED_KWARGScreate_video_processor() uses named kwargs; camera args as separate kwargsskill_06_sop_process_manager.md
LIVE_REQUIRES_STREAM_TRUEstream: true required for live inputs (RTSP / camera)skill_08_basler_camera.md
VLM_DISABLED_DISABLES_SOP_CHECKERDISABLE_VLM_INFERENCE=true auto-disables SOP checker at importskill_06_sop_process_manager.md
CHUNK_PARAMS_MAX_LENGTHChunkParams.max_length_sec = 10s internal; 60s API defaultskill_06_sop_process_manager.md
VLM_WARMUP_BEFORE_DDMModelInitializer: VLM warmup FIRST, then CV dummy pipelineskill_06_sop_process_manager.md
VLM_WARMUP_3_FRAMESVLM warmup needs 3 frames (torch.zeros) — Qwen3VL hangs on < 3skill_06_sop_process_manager.md
THREAD_POOL_SIZES4 thread pools: cv(32), clip(32), vlm_inference(64), vlm_request(64)skill_06_sop_process_manager.md
MEDIA_INFO_PYMEDIAINFOMedia info via pymediainfo; live sources set fps=30/duration=inf directlyskill_06_sop_process_manager.md
CAMERA_EMULATION_PYLON_CAMEMUPYLON_CAMEMU=1 for camera emulation (serial 0815-0000)skill_08_basler_camera.md
DEEPSTREAM_LIB_HIDEDeepStream lib hide trick: rename lib → lib.tmp during gst-plugin-pylon buildskill_08_basler_camera.md
VLM_REAL_GPU_FRAMESVLM uses real GPU frames via DecodedFrameRetriever; never torch.zeros for inferenceskill_06_sop_process_manager.md
BUFFER_RETRIEVER_STATIC_BASEDecodedFrameRetriever MUST inherit BufferRetriever statically via super().__init__(); runtime __class__.__bases__ mutation hangs pipeline.attach()skill_06_sop_process_manager.md
FRAME_RETRIEVER_PRIORITYcreate_inference_pipeline: frame_retriever= kwarg takes priority over frame_queueskill_03_deepstream_pipeline.md
MUX_ORIGINAL_RESOLUTIONnvstreammux uses original resolution (not 224); pass mux_width/mux_height from get_media_info() (probe live RTSP for non-camera inputs; camera path unaffected)skill_03_deepstream_pipeline.md, skill_06_sop_process_manager.md
FILE_URI_NO_DOUBLE_PREFIXcreate_inference_pipeline file source: check file_path.startswith("file://") before prepending — API passes file:// URLs directlyskill_03_deepstream_pipeline.md
CLEANUP_ON_DISCONNECTPipeline cleanup on client disconnect via trigger_stop_processors in try/finallyskill_07_sse_streaming.md
UNIFIED_CLIP_POST_PROCESSUnified clip_post_process() for file + live; stop() puts None in _score_queueskill_06_sop_process_manager.md
ABORT_INFLIGHT_VLMAbort in-flight VLM requests on stop() via llm.abort(req_id)skill_06_sop_process_manager.md
LOGGER_EXPORT_GET_LOGGERds_logger.py must export get_loggerskill_06_sop_process_manager.md
KAFKA_USE_CREATE_PRODUCERKafka: use create_producer() from messager.py; no Messager classskill_06_sop_process_manager.md
USER_PROMPT_PRIORITYUser request text takes priority over VLM_PROMPT_PATH file; {"type":"text"} in the request overrides the config-file promptskill_06_sop_process_manager.md
EVAL_USE_CONFIG_PROMPTEval/latency requests omit request text by default so the VLM uses VLM_PROMPT_PATHskill_12_evaluation_workflow.md, skill_13_verification_curl.md, skill_15_latency_measurement.md, skill_17_camera_latency_measurement.md
CHUNK_SCHEMA_FIELD_NAMESChunk schema: chunk_idx, cv_boundary_score, checker_result; summary chunk_idx=-1skill_06_sop_process_manager.md
SEQUENTIAL_FRAME_DRAINDrain decoded_frame_queue (FIFO, shared across chunks) in a SINGLE thread and submit VLM per chunk incrementally; parallel drain steals frames → 0-frame chunks / wrong VLM inputskill_06_sop_process_manager.md
WALL_CLOCK_BEFORE_GPUDecodedFrameRetriever.consume(): capture wall_clock_entry = time.time() BEFORE GPU dlpack; queue 3-tuple (timestamp, wall_clock_entry, tensor)skill_06_sop_process_manager.md, skill_17_camera_latency_measurement.md
CHUNK_E2E_PIPELINE_TIMESTAMPSWrite pipeline_chunk_end_timestamp (last frame wall_clock) and pipeline_vlm_ready_timestamp (tm_e2e.now()) into chunk_info for camera latency (§ 17)skill_06_sop_process_manager.md, skill_17_camera_latency_measurement.md
VLM_INFERENCE_REQUIRED_KWARGSEvery VLLMInference.inference() call must pass video_fps, system_prompt, max_completion_tokensskill_06_sop_process_manager.md
UNIFORM_CHUNKING_BYPASSES_DDMchunking_options.algorithm="uniform" → fixed-length chunks; create_inference_pipeline(uniform_chunk=True) skips DDM but keeps tee1 fanout; Stage 2 uses uniform_clip_post_processskill_02_pydantic_schemas.md, skill_03_deepstream_pipeline.md, skill_06_sop_process_manager.md
DDM_TEMPORAL_CONFIGURABLESLIDING_WINDOWS_SIZE = 2*FRAMES_PER_SIDE + SEQUENCE_BATCH rendered into preprocess/nvinferserver (no hard-coded 18); Triton config.pbtxt sequence dim -1skill_04_config_templates.md, skill_05_triton_ddm_model.md
DDM_TRT_OPTIONAL_PATHDDM_TRT_OPTIMIZATION=true runs DDM via TensorRT (per-thread contexts, fixed batch = SEQUENCE_BATCH); PyTorch fallback; never both. PyTorch is defaultskill_05_triton_ddm_model.md
DDM_TRT_STREAM_ORDERINGDDMTensorRTEngine.infer(): wait_stream(current) → execute_async_v3 → torch.cuda.synchronize(device) (NOT per-stream). Per-stream sync leaves TRT aux-stream work in flight → gst-CV SIGSEGV (NVBug 6289256)skill_05_triton_ddm_model.md
METADATA_LICENSE_FROM_FILE/v1/metadata reads licenseInfo from DS_SOP_LICENSE_PATH (default /opt/nvidia/nvds_sop/license.txt); never hard-code license textskill_01_fastapi_endpoints.md
CAMERA_EMULATION_FRAMES_RGBPylon emulation PNGs must be explicit 3-channel RGB (matches Emulation_0815-0000.pfs PixelFormat=RGB8Packed); generate via nvvideoconvert ! videoconvert ! "video/x-raw,format=RGB" ! pngencskill_08_basler_camera.md
COMPOSE_ENV_PASSTHROUGHdocker compose only substitutes ${VAR} references; every runtime env var must be explicitly listed under environment: to reach the container.skill_09_docker_build_deploy.md

The four RTSP_* rules below apply only when the optional RTSP streaming-output feature (§ 18) is requested. They do not apply to the default build — skip them if the user did not ask for RTSP output.

| RTSP_OUTPUT_TAPS_TEE1 | RTSP output branch links from the existing tee1 (added after the main inference link) only when rtsp_port is present. | skill_18_rtsp_streaming_output.md | | RTSP_LEAKY_QUEUE_TINY | RTSP branch queue must be leaky=2 + tiny cap (max-size-buffers=2) to prevent backpressure and NVMM pool exhaustion. | skill_18_rtsp_streaming_output.md | | RTSP_KEYINT_MAX_30 | RTSP H.264 encoder must set key-int-max=30 (and B-frames disabled) to allow downstream seeking. | skill_18_rtsp_streaming_output.md | | RTSP_ENCODER_FALLBACK | Select software/hardware H.264 encoder based on SW_ENCODER with MJPEG fallback. | skill_18_rtsp_streaming_output.md |


附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Deepstream Sop AI 技能有什么作用?

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the user does not name it: verify operator step sequence, detect missing or out-of-order SOP steps, score factory/work-cell video for procedure compliance, run VLM-based SOP checking on industrial cameras, or call /v1/chat/completions with a file, RTSP, or Basler camera. Also trigger...

为什么在 TypingMind 中使用 Deepstream Sop?

因为您只需安装一次,就能搭配任何模型使用。Deepstream Sop 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Deepstream Sop?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/NVIDIA/skills/tree/main/skills/deepstream-sop。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Deepstream Sop?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Deepstream Sop 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Deepstream Sop 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Deepstream Sop AI 技能免费吗?

是的。NVIDIA 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇