Two objects' Obj_meta->object_id are the same in the same frame with different bbox

Please provide complete information as applicable to your setup.

• GTX 1070
• DeepStream 5.1
• TensorRT 7.2.3
• Nvidia Driver 465
• Issue Type: questions

I am doing something similar as deepstream-infer-tensor-meta-test. I am logging all the objects to a local file.
However, sometimes in the same frame (NvDsMetaList * l_frame = batch_meta->frame_meta_list), there are two different objects with different bbox (although they are very close), which shared the same obj_meta->object_id. Shouldn’t the object_id be the unique id that only appear once each frame? How can I avoid this situation because I notice the final video doesn’t have two bbox with the same id (I print all the id to its label) on that frame.

• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Yes, it should be, can you dump the frame where 2 bboxes with same object id?

@bcao

How should I dump the frame?
Also I kind of figured out it might be the tracker’s problem. The same unique ID only happens on sgie_pad_buffer_probe. But on osd_sink_pad_buffer_probe there is only one ID.

Could you share how do you find it inside the probe?

@bcao

So this is the code I use in sgie_pad_buffer_probe

  for (NvDsMetaList * l_frame = batch_meta->frame_meta_list; l_frame != NULL;
      l_frame = l_frame->next) {
    NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) l_frame->data;
    /* Iterate object metadata in frame */
    for (NvDsMetaList * l_obj = frame_meta->obj_meta_list; l_obj != NULL;
        l_obj = l_obj->next) {
      NvDsObjectMeta *obj_meta = (NvDsObjectMeta *) l_obj->data;
      int object_id = obj_meta->object_id;
      int class_id = obj_meta->class_id;
      unsigned int left = obj_meta->rect_params.left;
      unsigned int top = obj_meta->rect_params.top;
      unsigned int width = obj_meta->rect_params.width;
      unsigned int height = obj_meta->rect_params.height;

I have a log of all these data each frame. It doesn’t happen always, but sometimes it has two same object_id for the same class_id. I think it shouldn’t happen.

@bcao

I kind of figured it out. It seems a problem that Non-Max Suppression has not been done correctly if I just simply do the loop for

   for (NvDsMetaList * l_obj = frame_meta->obj_meta_list; l_obj != NULL;
       l_obj = l_obj->next) {

How can I get the data and info of the results of the bounding boxes after the non-max suppression?

Maybe you can choose no-cluster mode for post processing via cluster-mode , refer Gst-nvinfer — DeepStream 6.1.1 Release documentation

I will do some tests .