Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) [GeForce RTX 3070 Ti]
• DeepStream Version version 6.0.0
• JetPack Version (valid for Jetson only)
• TensorRT Version TensorRT-8.2.1.8
• NVIDIA GPU Driver Version (valid for GPU only) CUDA Version: 11.5
• Issue Type( questions, new requirements, bugs)
• 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 have got the coordinates of the target and want to add it to the deepstream project through metadata, but when I use tracker, the obj_meta.object_id is always 0 and cannot be tracked normally
How should I assign values to use the trancker plugin???
The code is as follows:
…
queue1.link(pgie)
pgie.link(queue2)
queue2.link(tracker)
tracker.link(queue3)
queue3.link(nvdsanalytics)
…
def add_obj_meta_to_frame(frame_object, batch_meta, frame_meta, label_names, index=-1, KeyPoint_list=None):
“”" Inserts an object into the metadata “”"
# this is a good place to insert objects into the metadata.
# Here’s an example of inserting a single object.
pyds.nvds_acquire_meta_lock(batch_meta)
obj_meta = pyds.nvds_acquire_obj_meta_from_pool(batch_meta)
# Set bbox properties. These are in input resolution.
rect_params = obj_meta.rect_params
rect_params.left = int(frame_object.left)
rect_params.top = int(frame_object.top)
rect_params.width = int(frame_object.width)
rect_params.height = int(frame_object.height)
# Semi-transparent yellow backgroud
rect_params.has_bg_color = 0
rect_params.bg_color.set(1, 1, 0, 0.4)
# Red border of width 3
rect_params.border_width = 3
rect_params.border_color.set(1, 0, 0, 1)
# Set object info including class, detection confidence, etc.
obj_meta.confidence = frame_object.detectionConfidence
obj_meta.class_id = frame_object.classId
# There is no tracking ID upon detection. The tracker will
# assign an ID.
obj_meta.object_id = UNTRACKED_OBJECT_ID
# Set the object classification label.
obj_meta.obj_label = label_names[frame_object.classId]
# Set display text for the object.
txt_params = obj_meta.text_params
if txt_params.display_text:
print(txt_params.display_text)
pyds.free_buffer(txt_params.display_text)
txt_params.x_offset = int(rect_params.left)
txt_params.y_offset = max(0, int(rect_params.top) - 10)
txt_params.display_text = (str(obj_meta.object_id) + " " + label_names[frame_object.classId] + " " +
"{:04.3f}".format(frame_object.detectionConfidence))
# Font , font-color and font-size
txt_params.font_params.font_name = "Serif"
txt_params.font_params.font_size = 10
# set(red, green, blue, alpha); set to White
txt_params.font_params.font_color.set(1.0, 1.0, 1.0, 1.0)
# Text background color
txt_params.set_bg_clr = 1
# set(red, green, blue, alpha); set to Black
txt_params.text_bg_clr.set(0.0, 0.0, 0.0, 1.0)
pyds.nvds_add_obj_meta_to_frame(frame_meta, obj_meta, None)
pyds.nvds_release_meta_lock(batch_meta)