Drawing the objects on the skipped frames nvinfer when internval != 0

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) :
• DeepStream Version : 6.3
• JetPack Version (valid for Jetson only) : N/A
• TensorRT Version :
• NVIDIA GPU Driver Version (valid for GPU only) :
• Issue Type( questions, new requirements, bugs) question
• 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)

I am using the python version. I want to run inference only on some frames. rest of the frames I want to leverage the last inference results and draw.

I am setting the interval to non zero value DS_plugin_gst-nvinfe

I explored : DS_plugin_gst-nvtracker

it looks like there was a function but its deprecated (enable-past-frame )


Alternative i can add a probe and track previous results and draw it until the nvinference runs again
but I don’t see any examples of drawing custom rectangle.

Any suggestion?

Hi @patidarchat

I don’t know if there is an out-of-the-box solution in DeepStream for that. What I would do is create a filter element that stores the last valid meta and copies it into the buffers without meta.

In C, you can copy the entire DS meta with something like this:

      gpointer state = NULL;
      GQuark nvdsmeta_quark = g_quark_from_static_string (NVDS_META_STRING);
      GstMeta *gst_meta;
      while ((gst_meta = gst_buffer_iterate_meta (last_buffer, &state))) {
        /* DeepStream meta */
        if (gst_meta_api_type_has_tag (gst_meta->info->api, nvdsmeta_quark)) {
          GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
          const GstMetaInfo *info = gst_meta->info;
          info->transform_func (new_buffer, gst_meta, last_buffer, _gst_meta_transform_copy, &copy_data);

Another option is to save a copy of the last valid meta, manually copying the fields you are interested in.

It’s similar to drawing the text in deepstream_test_1.py.
Just change the text_params to rect_params and set corresponding properties.

@yuweiw : Guess that only works when rectangles are already there, in my case the frames will not have rectangle as inference would have been skipped and new rectangle need to be created in c memory

@miguel.taylor : I will check this, I need to move the code to c layer for it as this may not be doable in python layer from my understanding

Are there any standard functions are there to free the buffer or regular delete should be good

You must use gst_buffer_ref to increase the refcount while you are using the buffer and gst_buffer_unref when you no longer need it. GStreamer will perform the free once the refcount is zero.

Looks like the feature is supported out of the box, didn’t needed to make the code change . Thanks for the support. this can be closed for now.

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