docs: document frame metadata access in output converters - #1178
Merged
Conversation
Document the optional, opt-in `metadata` argument for model output converters (#1172), which passes the frame's NvDsFrameMeta (source_id, pts, video_frame, objects, tags) to a converter's __call__ when it declares the parameter. Added to the detector-model chapter's Converter section: usage, backward-compatibility/signature-inspection note, the convert-output telemetry span, and a pointer to the output_converter_metadata sample and Etcd reconfiguration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbsaV4NhYriTyUqxuzKd8Q
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Savant 101 detector-model documentation to explain how output converters can optionally receive per-frame context via the new metadata argument, enabling context-aware post-processing while staying backward compatible.
Changes:
- Adds an “Accessing Frame Metadata In A Converter” subsection under the detector-model “Converter” docs.
- Documents how to opt in via a
metadata: Optional[NvDsFrameMeta] = Noneparameter on__call__. - Links to the
output_converter_metadatasample and cross-references the Etcd dynamic-reconfiguration page.
Address review feedback on the output-converter metadata docs: - Note that `metadata` can be None at call time even when the converter declares the parameter (the framework passes None when the frame's VideoFrame context is unavailable), so converters should guard for None. - Correct the performance wording: signature inspection is cached per converter class and not repeated per frame, but a cached lookup still happens per frame (not "no per-frame overhead"). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbsaV4NhYriTyUqxuzKd8Q
Minor grammar fix per review, matching the style used elsewhere in the docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbsaV4NhYriTyUqxuzKd8Q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the optional
metadataargument for model output converters, added in #1172 ("Support metadata passing to converters").Change
docs/source/savant_101/30_dm.rst— adds an "Accessing Frame Metadata In A Converter" subsection to the detector-model chapter's Converter section, covering:metadata: Optional[NvDsFrameMeta] = Noneparameter on the converter's__call__(with a code snippet).source_id,pts, the underlyingvideo_frame, the frame's objects, and tags.__call__signature once (cached per converter class, no per-frame overhead) and passesmetadataonly when declared, so existing/built-in converters keep working unchanged. Also notes the nestedconvert-outputtelemetry span.output_converter_metadatasample and a cross-link to the Etcd dynamic-reconfiguration page.Notes
reference/api/converter.rst) is auto-generated from docstrings, which Support metadata passing to converters #1172 already updated, so no manual change is needed there — themetadataparameter flows through automatically.:doc:Etcd target resolves, and theNvDsFrameMetacross-reference uses the fully-qualifiedsavant.deepstream.meta.framepath.🤖 Generated with Claude Code
Generated by Claude Code
Note
Low Risk
Documentation-only change with no runtime or API behavior modifications.
Overview
Adds "Accessing Frame Metadata In A Converter" under the detector-model Converter section in
30_dm.rst, documenting the optionalmetadataargument on converter__call__(from #1172).The new text explains how to opt in with
metadata: Optional[NvDsFrameMeta] = None, what fields are available (source_id,pts,video_frame, objects, tags), and that callers must handleNone. It also notes opt-in / backward compatibility (signature inspected once per class, cached), nestedconvert-outputtelemetry when metadata is used, and links to theoutput_converter_metadatasample plus the Etcd dynamic-reconfiguration doc for per-source thresholds.Reviewed by Cursor Bugbot for commit b9cf7b0. Bugbot is set up for automated code reviews on this repo. Configure here.