Skip to content

nvmmdrawdet

Detection overlay for viewing — draws GstNvmmDetMeta boxes (e.g. from nvmminfer) onto the frame. A dependency-free OSD: no DeepStream, no Cairo/Pango — labels use a small built-in 6×8 bitmap font (generated by tools/gen_font.py from DejaVu Sans Mono).

Sink: video/x-raw(memory:NVMM), format=NV12 (+ det meta) → Src: video/x-raw, format=RGBA (system memory) with class-colored boxes and label #tracker_id conf% text bars.

Intended for demos, visualization and end-to-end tests (encode + stream the result) — not the zero-copy data path: it converts NV12 → RGBA on the VIC, pulls the frame to host via EGL/CUDA, and draws on the CPU.

Properties

Property Type Default Notes
thickness int (1–32) 3 Box line width (px)
draw-track bool true Draw the GstNvmmTrackMeta box + live FPS/coverage HUD
draw-det bool true Draw the raw YOLO GstNvmmDetMeta boxes/labels
draw-labels bool true Draw the label [#id] conf% bar above each box
fps-smoothing double (0–1) 0.9 EMA weight on the HUD FPS (0 = instantaneous)
font-scale-divisor int 540 Overlay font px = max(1, frame_height / this)

When a nvmmfusekf (or nvmmsamurai) track is present, draw-track overlays the fused track box labelled target conf% plus a top-left FPS / TRACK% HUD (coverage = valid-track frames ÷ total). Set draw-det=false to show only the track box without the raw detections.

When an upstream nvmmtracker has assigned a tracker_id, the label shows it (car #4 82%); otherwise just car 82%. When nvmmsecondaryinfer has attached a GstNvmmClassMeta, the classification is appended (car #4 82% [taxi 91%]); fused motion meta adds >> and a heavier box for movers. The font scale auto-derives from frame height (~3× at 1080p).

The element implements transform_size so its packed-RGBA output buffers are sized from the output caps regardless of what downstream proposes (an NVMM input buffer's size is a surface handle, not a pixel count), and it refuses to write into an undersized output buffer. Any downstream raw-video consumer works, including caps-any sinks like fakesink.

... ! nvmminfer engine-file=yolo.engine ! nvmmtracker ! nvmmdrawdet \
    ! videoconvert ! x264enc tune=zerolatency ! matroskamux streamable=true \
    ! tcpserversink host=0.0.0.0 port=6000