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
DXObjectMetaobjects and attaches them to the correspondingDXFrameMeta - Secondary Mode: Modifies existing
DXObjectMetabased 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 functionfunction-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
| Name | Description | Type | Default Value |
|---|---|---|---|
name | Sets the unique name of the DxPostprocess element. | String | "dxpostprocess0" |
config-file-path | Path to the JSON config file containing the element's properties. | String | null |
inference-id | Specifies the ID of the DxInfer output tensor to use for postprocessing. | Integer | 0 |
secondary-mode | Enables Secondary Mode for processing object regions. | Boolean | false |
library-file-path | Path to the custom preprocess library, if used. | String | null |
function-name | Name of the custom preprocessing function to use. | String | null |
Example JSON Configuration
{
"inference_id": 1,
"library_file_path": "/usr/local/share/gstdxstream/lib/libpostprocess_yolo.so",
"function_name": "YOLOV5Pose_1"
}
- 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”.