PyDs 7.1 Sgie: layer_info.buffer == None (bodypose)

• Hardware Platform: Jetson
• DeepStream Version: 7.1-triton
• Issue Type: SGIE buffer None



Hi everyone,

I’m building a DeepStream 7.1 Python pipeline on Jetson using JetPack 6.2. It’s based on the multi-input multi-output Python sample, and I’m using a custom SGIE model for 2.5D pose estimation (like OpenPose 25 keypoints + Z + confidence). The model outputs a single layer named pose25d with shape [1, 34, 4].

In the C++ code, everything works fine. I’m able to run tensor_meta->out_buf_ptrs_host, visualize the pose keypoints, and use them as expected.

im using the same config infer files:

However, i wanted the same in python..in the Python app, when I try to access the layer data like this:

def parse_pose_from_meta(frame_meta, obj_meta):

    ##PGIE
    class_id = obj_meta.class_id
    confidence = obj_meta.confidence
    if class_id == 0:
        left = int(obj_meta.rect_params.left)
        top = int(obj_meta.rect_params.top)
        width = int(obj_meta.rect_params.width)
        height = int(obj_meta.rect_params.height)
        print(left, top, width, height)         # outputs 1283 190 270 679 # ✅ Works



    ##SGIE
    # # # print(dir(obj_meta))
    # ls = ['base_meta', 'cast', 'class_id', 'classifier_meta_list', 'confidence', 'detector_bbox_info', 'mask_params', 
    # 'misc_obj_info', 'obj_label', 'obj_user_meta_list', 'object_id', 'parent', 'rect_params', 'reserved', 
    # 'text_params', 'tracker_bbox_info', 'tracker_confidence', 'unique_component_id']

    # for i in ls:
    #     print(f"Attribute {i}: {getattr(obj_meta, i)}")

    user_meta_list = obj_meta.obj_user_meta_list
    while user_meta_list is not None:
        user_meta = pyds.NvDsUserMeta.cast(user_meta_list.data)
        if user_meta and user_meta.base_meta.meta_type == pyds.NvDsMetaType.NVDSINFER_TENSOR_OUTPUT_META:
            tensor_meta = pyds.NvDsInferTensorMeta.cast(user_meta.user_meta_data)

            # # print(dir(tensor_meta))
            # ls2 =  ['cast', 'gpu_id', 'network_info', 'num_output_layers', 'out_buf_ptrs_dev', 'out_buf_ptrs_host', 'output_layers_info', 'priv_data']

            # for i in ls2:
            #     print(f"Attribute {i}: {getattr(tensor_meta, i)}")


            ptrs = tensor_meta.out_buf_ptrs_dev
            print(dir(ptrs))
            # print(dir(ptrs.cast))


            num_layers = tensor_meta.num_output_layers
            print(f"Found tensor meta with {num_layers} layers")

            for i in range(num_layers):
                layer_info = tensor_meta.output_layers_info(i)  
                layer_name = layer_info.layerName
                print(f"Layer {i}: {layer_name}")
                
                if layer_info.buffer is not None:
                    dims = layer_info.inferDims
                    print(f"{layer_name} shape: {[dims.numElements()]} ({dims.d[0]}x{dims.d[1]}x{dims.d[2]})")
                else:
                    print(f"{layer_name} buffer is None")
        user_meta_list = user_meta_list.next

 # Always prints None...

it outputs all the time, all the way buffer None:

Found tensor meta with 4 layers
Layer 0: pose2d
pose2d buffer is None
Layer 1: pose2d_org_img
pose2d_org_img buffer is None
Layer 2: pose25d
pose25d buffer is None
Layer 3: pose3d
pose3d buffer is None

layer_info.buffer is always None, even though in the C++ version, the buffer has valid values.


Things I’ve Checked:

  • SGIE model works in DeepStream C++ with custom parser
  • Tensor metadata (tensor_meta.num_output_layers) is correct
  • Layer name is correctly matched as pose25d
  • Model is ONNX and engine is generated correctly (verified with trtexec and in C++)
  • out_buf_ptrs_host in C++ has valid floats for all keypoints

My Question:

Is there an additional step or setting in the DeepStream Python pipeline to ensure layer_info.buffer is filled correctly for SGIE outputs?

Or should I be accessing tensor_meta.out_buf_ptrs_host directly from Python using ctypes or another method?

i want to access the SGIE output tensor values in pyds

Any help would be appreciated. I can also share my config file and parser if needed.

Thanks in advance!

Please use get_nvds_LayerInfo to get layer info, Otherwise it is invalid

infer_meta = pyds.NvDsInferTensorMeta.cast(user_meta.user_meta_data)
print(f"[DBG] num_output_layers={infer_meta.num_output_layers}")
for layer_idx in range(infer_meta.num_output_layers):
       layer = pyds.get_nvds_LayerInfo(infer_meta, layer_idx)
       array = layer_tensor_to_ndarray(layer)
        print(f"[DBG] {layer.layerName} layer_info.buffer address = {type(array)}")

This is similar to this topic