本文へスキップ
SDK Version: Next

DxPostprocess

DxPostprocess is a pipeline element that handles output tensors generated by the DxInfer element. It performs model-specific post-processing, such as classification, detection, or segmentation, and produces structured results by creating or modifying DXObjectMeta.

The component supports both built-in and user-defined logic, depending on the configured model type. Processed results are attached to DXFrameMeta, enabling downstream tasks such as visualization, event handling, or application-specific decisions.

Key Features

Modes of Operation

  • Primary Mode: Creates new DXObjectMeta objects and attaches them to the corresponding DXFrameMeta
  • Secondary Mode: Modifies existing DXObjectMeta based on updated inference results from DxInfer

Custom Postprocessing
You can use a custom post-processing function by specifying:

  • library-file-path: Path to the shared object (.so) containing your custom function
  • function-name: Name of the function to be called

The custom function signature has been updated to include GstBuffer access:

extern "C" void PostProcess(GstBuffer *buf,
std::vector<dxs::DXTensor> network_output,
DXFrameMeta *frame_meta,
DXObjectMeta *object_meta);

This allows full flexibility to implement custom decoding, filtering, or data transformation logic with direct access to the GStreamer buffer.

Hierarchy

GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseTransform
+----GstDxPostprocess

Pad Templates

Sink (input)

PropertyValue
Formatvideo/x-raw; application/x-dxvideoraw

Src (output)

PropertyValue
Formatvideo/x-raw; application/x-dxvideoraw

Domain Mode Behavior

dxpostprocess is a dual-mode, stateless element (see Multi-Stream Domain). Behavior is identical whether the sink caps are video/x-raw (single stream) or application/x-dxvideoraw (domain) — the element reads per-buffer information from DXFrameMeta/DXObjectMeta either way.

Properties

NameDescriptionTypeDefault Value
nameSets the unique name of the DxPostprocess element.String"dxpostprocess0"
config-file-pathPath to the JSON config file containing the element's properties.Stringnull
inference-idSpecifies the ID of the DxInfer output tensor to use for postprocessing.Integer0
secondary-modeEnables Secondary Mode for processing object regions.Booleanfalse
library-file-pathPath to the custom preprocess library, if used.Stringnull
function-nameName of the custom preprocessing function to use.Stringnull

Example JSON Configuration

{
"inference_id": 1,
"library_file_path": "/usr/local/share/gstdxstream/lib/libpostprocess_yolo.so",
"function_name": "YOLOV5Pose_1"
}
NOTE
  • All properties can also be configured using a JSON file for enhanced usability and flexibility.
  • For implementing custom postprocess logic, refer to Chapter. Writing Your Own Application “Custom Post-Process Library Documentation”. Custom libraries must follow the error reporting contract described there (no g_error() / abort(); use g_warning() for per-frame skips and throw std::runtime_error for permanent errors).