GstNvInfer does not have property secondary-reinfer-interval

• Hardware Platform (Jetson / GPU) Jetson Xavier NX
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 32.4.3
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)

Hello! I’ve trained a classifier model to be used in Python DeepStream 5.0 using the latest TLT 2.0 and operate on one class-id of PGIE. I’m also using libnvds_nvdcf tracker. The thing is that it seems to me that secondary inference is not running in every frame as I would like. Reading the DS Plugin Manual ( I found there’s an option in SGIE called secondary-reinfer-interval and as the description says, it makes the SGIE to reinfer over the objects in n frames. When I apply that option in SGIE config file it launches the error: GstNvInfer does not have property secondary-reinfer-interval. Am I using the wrong way that option?
Thanks in advance!

  1. if there is not object for 2nd gie, the 2nd gie will be skipped
  2. with tracker, as mentiond below in

When the plugin is operating as a secondary classifier along with the tracker, it tries to improve performance by avoiding re-inferencing on the same objects in every frame. It does this by caching the classification output in a map with the object’s unique ID as the key. The object is inferred upon only when it is first seen in a frame (based on its object ID) or when the size (bounding box area) of the object increases by 20% or more. This optimization is possible only when the tracker is added as an upstream element.

1 Like

Thanks for the response.
What about the property “secondary-reinfer-interval”?

sorry for missing it! yes, it can be also used to skip some batches as defined in secondary-reinfer-interval

1 Like

Yes! But it says that this property doesn’t exist! I’ve added it to the sgie_config file and the error GstNvInfer does not have property secondary-reinfer-interval appears.

refer to

it’s just “interval”, e.g. interval=2

But as it says in the same document, “interval” property just applies over Primary (in this case, the primary object detector) and I’m already using it. The error I mentioned occurs for Secondary (the classifier I trained using TLT).

About secondary-reinfer-interval, after checking the code and doc again, secondary-reinfer-interval means to to do inference to current frame if current frame num - last inference frame > **secondary-reinfer-interval**.

Code -

File: /opt/nvidia/deepstream/deepstream-5.0/sources/gst-plugins/gst-nvinfer/gstnvinfer.cpp

/* Function to decide if object should be inferred on. */
static inline gboolean
should_infer_object (GstNvInfer * nvinfer, GstBuffer * inbuf,
    NvDsObjectMeta * obj_meta, gulong frame_num,
    GstNvInferObjectHistory * history)
     /* History is irrevelavant for detectors. */
  if (history && IS_CLASSIFIER_INSTANCE (nvinfer)) {
    gboolean should_reinfer = FALSE;

    /* Do not reinfer if the object area has not grown by the reinference area
     * threshold and reinfer interval criteria is not met. */
    if ((history->last_inferred_coords.width *
          history->last_inferred_coords.height * (1 +
        (obj_meta->rect_params.width * obj_meta->rect_params.height))
      should_reinfer = TRUE;

    if (frame_num - history->last_inferred_frame_num >
         nvinfer->secondary_reinfer_interval)                // this secondary_reinfer_interval is the value of secondary-reinfer-interval  defined in the config file
      should_reinfer = TRUE;

    return should_reinfer;

  return TRUE;
1 Like

yes, confirmed again interval is only applable to pgie, sorry & thanks!

1 Like

I’ll give it a try! Thanks!