• Hardware Platform (Jetson / GPU) Jetson Xavier NX • DeepStream Version 5.0 • JetPack Version (valid for Jetson only) 32.4.3 • TensorRT Version 7.1.3.1 • 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 (NVIDIA DeepStream SDK Developer Guide — DeepStream 6.1.1 Release documentation) 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!
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.
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.
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**.
/* 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 +
REINFER_AREA_THRESHOLD)) <
(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;
}