How to get meta when classifier is pgie

• Jetson AGX Xavier
• Deepstream 6.0
• JetPack 4.6
• TensorRT 8.0.1
• NVIDIA GPU Driver 32.6.1

Hi, i’m trying to a simple classification pipeline, I need to get labels what my model predicted. In osd_sink_pad_buffer_probe() function i’m trying to get obj_meta_list as written there: Primary classifier class_id=-1 and result_prob=0.58 for all frames and there: Access output of Primary Classifier and get NvDsClassifierMeta. But frame_meta.obj_meta_list return None.

Here is my config:

process-mode=1 # Process full frames
network-type=1 # Classifier
network-mode=2 # FP16

And here is code

def osd_sink_pad_buffer_probe(pad,info,u_data):
  gst_buffer = info.get_buffer()
      if not gst_buffer:
          print("Unable to get GstBuffer ")
      batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
      l_frame = batch_meta.frame_meta_list
      while l_frame is not None:
              frame_meta = pyds.NvDsFrameMeta.cast(
          except StopIteration:
          frame_number = frame_meta.frame_num
          print(l_obj) --> It prints None

So how can I get labels that classifier returned?

Which model did you use, our demo model or your own model?
You can refer the link below first to get the object:

I use own resnet50

Well, I used it as a refer. I did the same, but l_obj is None. Why?

It may be your model’s problem. You can verify it by yourself.
1.You can attach your whole code or attach your pipeline graph.
2.You can modify some code to get the l_obj from our demo code that I attached to see if you can get the value from it. (9.8 KB)

Here is the code. I deleted some buisnes logic. It doesn’t tuch any MetaData.

Well, I can try your network in my code. It willn’t generate any normal results, but it can create object meta.

I used resnet10 with config from deepstream-test3. And l_obj is None

I’ve lounched deepstream-test2 and l_obj is not None. But there is a detector. So culd you tell me, is the problem in my pipeline or in way how i’m trying to get l_obj? I can’t understand

I’ve modified code and made sgie1 a primary detector (process-mode=1), and I didn’t get any objects. frame_meta.obj_meta_list returned None

There is no update from you for a period, assuming this is not an issue anymore.
Hence we are closing this topic. If need further support, please open a new one.

You should make sure that your model works well. You can refer the demo below to get the metadata:
You can try to use your model instead of our demo model to see if it works well.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.