Skip to main content

Examples

End-to-end recipes covering the most common deployment patterns.

Basic object detection

Detect objects in a video file and show results on screen.

pipeline:
name: "Object Detection"

streams:
- uri: "file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4"
source_id: 0

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo11"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

sinks:
width: 1280
height: 720
outputs:
- type: "display"

Pose estimation

pipeline:
name: "Pose Estimation"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
- name: "yolo-pose"
type: "pose"
architecture: "yolo_pose11"
onnx_file: /path/to/yolo11n-pose.onnx
label_file: /path/to/labels.txt
precision: "fp16"

sinks:
width: 1280
height: 720
outputs:
- type: "display"

Instance segmentation

pipeline:
name: "Instance Segmentation"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
- name: "yolo-seg"
type: "segmentation"
architecture: "yolo_seg11"
onnx_file: /path/to/yolo11s-seg.onnx
label_file: /path/to/labels.txt
precision: "fp16"

sinks:
width: 1280
height: 720
outputs:
- type: "display"

Detector + tracker + classifier chain

Detect vehicles, track them, then classify their color.

pipeline:
name: "Chaining Pipeline"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
# Primary detector
- name: "vehicle-detector"
type: "detector"
architecture: "yolo11"
onnx_file: /path/to/vehicle_model.onnx
label_file: /path/to/vehicle_labels.txt
active_classes: [0, 2]

# Tracker between detector and classifier
- type: "tracker"
tracker_type: "IOU"

# Secondary classifier on detected objects
- name: "color-classifier"
type: "classifier"
onnx_file: /path/to/color_model.onnx
label_file: /path/to/color_labels.txt
operate_on: "vehicle-detector"
operate_on_classes: [0, 2]

sinks:
width: 1280
height: 720
outputs:
- type: "display"

Kafka analytics (no video output)

Run detection and tracking, send results to Kafka, and print FPS.

pipeline:
name: "Kafka Analytics"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo11"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

- type: "tracker"
tracker_type: "NvSORT"

sinks:
width: 1920
height: 1080
outputs:
- type: "fps"
- type: "kafka"
broker: "kafka-host:9092"
topic: "detections"

Multi-stream with tiled RTSP output

Two cameras combined into a single tiled RTSP stream.

pipeline:
name: "Tiled Output"

streams:
- uri: "rtsp://camera1/live"
source_id: 0
- uri: "rtsp://camera2/live"
source_id: 1

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo11"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

- type: "tracker"
tracker_type: "IOU"

sinks:
width: 1280
height: 720
outputs:
- type: "rtsp"
url: "rtsp://localhost:8554/tiled"
codec: "h264"
bitrate: 4000000

Multi-stream with per-stream outputs

Two cameras, each with its own RTSP output plus a tiled display.

pipeline:
name: "Per-Stream Output"

streams:
- uri: "rtsp://camera1/live"
source_id: 0
- uri: "rtsp://camera2/live"
source_id: 1

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo11"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

- type: "tracker"
tracker_type: "NvSORT"

sinks:
width: 1280
height: 720
outputs:
- type: "display"
- type: "rtsp"
mode: "multi"
codec: "h264"
bitrate: 4000000
streams:
- source_id: 0
url: "rtsp://localhost:8554/cam0"
- source_id: 1
url: "rtsp://localhost:8554/cam1"

Triton detector

pipeline:
name: "Triton Detector"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
- name: "triton-detector"
type: "triton_detector"
triton:
model_name: "my_model"
server_url: "localhost:8001"
label_file: /path/to/labels.txt
batch_size: 4

sinks:
width: 1280
height: 720
outputs:
- type: "display"

Triton detector + classifier chain

pipeline:
name: "Triton Chaining"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
- name: "triton-detector"
type: "triton_detector"
triton:
model_name: "detector_model"
server_url: "localhost:8001"
label_file: /path/to/labels.txt

- type: "tracker"
tracker_type: "IOU"

- name: "triton-classifier"
type: "triton_classifier"
triton:
model_name: "classifier_model"
server_url: "localhost:8001"
label_file: /path/to/class_labels.txt
operate_on: "triton-detector"
operate_on_classes: [0, 2]

sinks:
width: 1280
height: 720
outputs:
- type: "display"