Loading...
Loading...
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.
npx skill4agent add nvidia/skills deepstream-sopsop-inference-bp/| Stage | Role | Model class | Default | Swap via |
|---|---|---|---|---|
| Stage 1 (CV) | Per-frame boundary scoring → chunk segmentation | Generic Event Boundary Detection (GEBD) | DDM (MCG-NJU/DDM) via Triton Python backend | Replace |
| Stage 3 (VLM) | Per-chunk action classification | Vision-language model via vLLM | Cosmos Reason 1 7B (Reason 2 also supported) | Set |
ddm-netuniformFRAMES_PER_SIDESEQUENCE_BATCHnvds-action-sopreferences/sop_architecture.svgSOPVideoProcessorInput 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)references/| § | File | Responsibility |
|---|---|---|
| 1 | | FastAPI endpoints, server init, Prometheus metrics |
| 2 | | Request/response Pydantic models ( |
| 3 | | DeepStream pyservicemaker pipeline, tensor parser, dummy pipeline |
| 4 | | nvdspreprocess / nvinferserver config templates + rendering |
| 5 | | Triton model repo, config.pbtxt, model.py, ddm_net.py |
| 5b | | C++ postprocess plugin, Makefile, IOptions API |
| 6 | | SOPProcessManager, SOPVideoProcessor, VLLMInference, Kafka |
| 6b | | SOP sequence and checker compliance: MissingNumberDetector, SopCheckerCache, SopCheckerRequest/Response |
| 7 | | SSE generator, stream response formatting, dummy test mode |
| 8 | | Basler camera support, Pylon SDK, emulation, formats |
| 9 | | Docker build, deploy, .env configuration |
| 10 | | Test suite coverage, assertions, running tests |
| 11 | | All environment variables reference |
| 12 | | End-to-end eval workflow: static checks, build, launch, tests, API/camera/Kafka checks, report |
| 13 | | Verification steps and curl examples |
| 14 | | Implementation checklist: file copy list, generated files, Docker prereqs, verification |
| 15 | | TTFC and C2C latency measurement for file input via SSE streaming |
| 16 | | Kafka message schema selection ( |
| 17 | | Camera / live-stream chunk_e2e latency measurement using internal pipeline timestamps |
| 18 | | OPT-IN RTSP streaming output: |
RTSP_*skill_14_implementation_checklist.mdreferences/IOptionsmodel.pyddm_net.pynvds_preprocess_template.txtnvds_inference_template.txtvlm_prompts.txtconfigs/skill_06bconfigs/actions.jsonnvds_action_detector/missing_number_detector.pyconfigs/actions.jsonEach rule's full detail lives in the linkedreference file.skill_NN_*.md
| Tag | Rule summary | Details in |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
| | |
| VLM warmup needs 3 frames ( | |
| 4 thread pools: | |
| Media info via | |
| | |
| DeepStream lib hide trick: rename lib → lib.tmp during gst-plugin-pylon build | |
| VLM uses real GPU frames via | |
| | |
| | |
| nvstreammux uses original resolution (not 224); pass | |
| | |
| Pipeline cleanup on client disconnect via | |
| Unified | |
| Abort in-flight VLM requests on | |
| | |
| Kafka: use | |
| User request text takes priority over | |
| Eval/latency requests omit request text by default so the VLM uses | |
| Chunk schema: | |
| Drain | |
| | |
| Write | |
| Every | |
| | |
| | |
| | |
| | |
| | |
| Pylon emulation PNGs must be explicit 3-channel RGB (matches | |
| | |
The fourrules 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_*
RTSP_OUTPUT_TAPS_TEE1tee1rtsp_portskill_18_rtsp_streaming_output.mdRTSP_LEAKY_QUEUE_TINYleaky=2max-size-buffers=2skill_18_rtsp_streaming_output.mdRTSP_KEYINT_MAX_30key-int-max=30skill_18_rtsp_streaming_output.mdRTSP_ENCODER_FALLBACKSW_ENCODERskill_18_rtsp_streaming_output.md