Detection of specific person's activity using PoseclassificationNet in Deepstream

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) RTX3080
• DeepStream Version6.4
I have earlier discussion here. Like to run 3D Skeleton and PoseClassification (secondary gies) on specific person based on his tracking number.
According to reply from earlier discussion, 3D Skeleton and PoseClassification (secondary gies) model run only on the specific person’s objectmeta which are added for secondary gies. Where is the place to control the inclusion of objectmeta.

Inside deepstream_pose_classification_app.cpp file, all code inside

static GstPadProbeReturn
pgie_src_pad_buffer_probe(GstPad *pad, GstPadProbeInfo *info,
                          gpointer u_data)

and

static GstPadProbeReturn
sgie_src_pad_buffer_probe(GstPad *pad, GstPadProbeInfo *info,
                          gpointer u_data)

are commented. But 3D Skeleton and PoseClassification models are still processing. So we can see label (such as walking, standing) on each person.
How can I control in the code (which part of the code) to proceed for secondary gie based on tracking id?

I am using nvinfer. Any suggestions?
Looked into deepstream_pose_classification_app.cpp, there is nothing much I can change.
pgie/sgie_src_pad_buffer_probe are for plotting. I turned off all codes inside the two probes, but still all people in image are still gone through for sgie inference. I can still see labels such as “walking, standing, etc”.
Where do i do changes to run through sgie for only specific person who’s tracking ID is selected.

sorry for the late reply. here are two methods.

  1. please refer to this topic for removing the objectmeta. then only the specific person will be processed.
  2. you can add a nvdspreprocess plugin be pgie. nvdspreprocess supports ROI functionality.

Thanks I am testing now. I tried to comment out source codes of NvDsInferParseCustomBodyPose3DNet in nvdsparsebbox_BodyPose3DNet.cpp, pad_buffer_probes from deepstream_pose_classification_app.cpp
But still activities are still classified and labelled. Still don’t know how to control.

Thanks, I’ll take a look now.

It is like, need to use nvds_remove_obj_meta_from_frame to remove object meta. Thanks

I tried to put this api nvds_remove_obj_meta_from_frame(frame_meta, obj_meta); inside both pgie_src_pad_buffer_probe and sgie_src_pad_buffer_probe. But secondary gies still have detections.
If l_obj = obj_next; is included, the application has segmentation fault.
This is pgie probe.

static GstPadProbeReturn
pgie_src_pad_buffer_probe(GstPad *pad, GstPadProbeInfo *info,
                          gpointer u_data)
{
  gchar *msg = NULL;
  GstBuffer *buf = (GstBuffer *)info->data;
  NvDsMetaList *l_frame = NULL;
  NvDsMetaList *l_obj = NULL;
  NvDsMetaList *l_user = NULL;
  NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(buf);

  //Padding due to AR SDK model requires bigger bboxes
  const int muxer_output_width_pad = _pad_dim * 2 + _image_width;
  const int muxer_output_height_pad = _pad_dim * 2 + _image_height;

  for (l_frame = batch_meta->frame_meta_list; l_frame != NULL;
       l_frame = l_frame->next)
  {
    NvDsFrameMeta *frame_meta = (NvDsFrameMeta *)(l_frame->data);  	
    for (l_obj = frame_meta->obj_meta_list; l_obj != NULL;
         l_obj = l_obj->next)
    {
      NvDsObjectMeta *obj_meta = (NvDsObjectMeta *) (l_obj->data);
      NvDsMetaList *obj_next = l_obj->next;
      nvds_remove_obj_meta_from_frame(frame_meta, obj_meta); 
      //l_obj = obj_next;     

    }
  }
  return GST_PAD_PROBE_OK;
}

This is sgie probe.

static GstPadProbeReturn
sgie_src_pad_buffer_probe(GstPad *pad, GstPadProbeInfo *info,
                          gpointer u_data)
{
  gchar *msg = NULL;
  GstBuffer *buf = (GstBuffer *)info->data;
  NvDsMetaList *l_frame = NULL;
  NvDsMetaList *l_obj = NULL;
  NvDsMetaList *l_user = NULL;
  NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(buf);

  // g_mutex_lock(&str->struct_lock);
  for (l_frame = batch_meta->frame_meta_list; l_frame != NULL;
       l_frame = l_frame->next)
  {
    NvDsFrameMeta *frame_meta = (NvDsFrameMeta *)(l_frame->data);   
    for (l_obj = frame_meta->obj_meta_list; l_obj != NULL; l_obj = l_obj->next)
    {
      NvDsObjectMeta *obj_meta = (NvDsObjectMeta *)l_obj->data;
      NvDsMetaList *obj_next = l_obj->next;
      if(obj_meta->class_id == PGIE_CLASS_ID_PERSON) 
      {
         nvds_remove_obj_meta_from_frame(frame_meta, obj_meta);          
      }
      //l_obj = obj_next;
    }
  }

  return GST_PAD_PROBE_OK;
}

sorry for the late reply! Is this still an DeepStream issue to support?

Now I understood. These probes are after pgie or sgie. So these are not the place to manage objectmetas for inference. I need to implement nvdspreprocess and plugin to pgie to manage objectmetas before inference happens.