• Hardware Platform (Jetson / GPU) RTX 3060 • DeepStream Version deepstream:5.1-21.02-devel • TensorRT Version 7.2.2-1+cuda11.1 • NVIDIA GPU Driver Version (valid for GPU only) 510.60.02 • Issue Type( questions, new requirements, bugs) Question
I am trying to extract the input of sgie-classifier, which is a nvinfer. My pipeline is same as deepstream-test2, I found a solution in this post but don’t know exactly how to implement this to extract the input in python application because it’s for the cpp application? As, I am a novice in deepstream development, looking forward for the solution for python application.
How are you going with this? I’m trying to test the same.
My model was trained using pytorch normalization and resize. So I’d like to verify the pre-processing nvinfer is doing is equivalent.
The nvinfer module includes normalization and I think also resizing by default. This happens inside the plugin, after the sink pad. So I’m quite sure a sink pad probe on nvinfer wont get me the exact network input.
Now I’m trying to use the nvdspreprocess module. Since it is a separate module in the pipeline, we should be able write a source pad to probe its output.
I’ve been able to write half of the python probe, and can confirm I see User Metadata at the batch level
However, pyds doesnt seem to have bindings for the NvDsPreProcessBatchMeta yet…
def probe_nvdspreprocess_pad_src_data(pad, info):
gst_buffer = info.get_buffer()
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
l_user = batch_meta.batch_user_meta_list
while l_user is not None:
user_meta = pyds.NvDsUserMeta.cast(l_user.data)
""" I should be able to cast to a NvDsPreProcessBatchMeta here, for example...
preProcessBatch = pyds.NvDsPreProcessBatchMeta.cast(user_meta.user_meta_data)
I glanced through the code, I can see that the struct exists in the NvDsPreProcessBatchMeta c code, but cant find the equivalent python binding.
Not sure if this is the way to get the information we are after, but thought I would throw it in :)