本文へスキップ
SDK Version: 2.3.3

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

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 preprocess logic, refer to Chapter. Writing Your Own Application “Custom Post-Process Library Documentation”.