• Hardware Platform (Jetson / GPU) Jetson • DeepStream Version 7.0 • JetPack Version (valid for Jetson only) 6.0 • TensorRT Version 10.4
I am tuning tracking parameters on deepstream. I’ve made a code that takes a video as an input and outputs another one with the bounding boxes and their IDs. The problem is the boxes only appear if they get an ID attributed by the tracker. So if the boxes disappear or take long to show, I am not sure if it is a detection problem or a tracking issue. Is there a way to display the boxes and signal they don’t have an ID yet with pyds?
The code you use to control the bbox display through the tracker is not deepstream, right?
Now you want to re-implement it through pyds? You can display the bbox through nvdsosd, then add a probe function to the src pad of nvdsosd, Then remove the object whose object_id value in obj_meta is UNTRACKED_OBJECT_ID (0xFFFFFFFFFFFFFFFF) from the object list
Yes, I am using a display function similar to the one in test_2.py . My problem is that I am not sure what happens when probation age is too high (20 frames in a 1FPS) video on tracking. I wanted to have an visual indication that my model detected the object even if tracking hasn’t given an valid ID to it. How could I modify this snippet to get bounding boxes to appear even if they do not have an ID yet?
def osd_sink_pad_buffer_probe(pad, info, u_data):
location = u_data
# Other initializations
gst_buffer = info.get_buffer()
if not gst_buffer:
print("Unable to get GstBuffer")
return
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
l_frame = batch_meta.frame_meta_list
while l_frame is not None:
try:
frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
except StopIteration:
break
obj_counter = {class_id: 0 for class_id in range(8)}
l_obj = frame_meta.obj_meta_list
while l_obj is not None:
try:
obj_meta = pyds.NvDsObjectMeta.cast(l_obj.data)
except StopIteration:
break
obj_counter[obj_meta.class_id] += 1
obj_meta.text_params.display_text = "" # Disable text display
# Set bounding box color based on class
if obj_meta.class_id == 1:
set_color(obj_meta.rect_params.border_color, colors["pos_cheia"])
elif obj_meta.class_id == 2:
set_color(obj_meta.rect_params.border_color, colors["atendente"])
elif obj_meta.class_id == 3:
set_color(obj_meta.rect_params.border_color, colors["pos_vazia"])
elif obj_meta.class_id == 4:
set_color(obj_meta.rect_params.border_color, colors["pos_sem_tec"])
elif obj_meta.class_id == 5:
set_color(obj_meta.rect_params.border_color, colors["cliente"])
obj_meta.text_params.display_text = f"ID: {obj_meta.object_id}"
elif obj_meta.class_id == 6:
set_color(obj_meta.rect_params.border_color, colors["espera"])
elif obj_meta.class_id == 7:
set_color(obj_meta.rect_params.border_color, colors["atendente_pe"])
try:
l_obj = l_obj.next
except StopIteration:
break
What does this mean? What parameters did you configure for the tracker?
Can you provide a sample that reproduces the problem? Because for deepstream_test_2.py, even if the nvtracker plugin is removed from the pipeline, the bbox can be displayed normally. In fact, whether the bbox is displayed has nothing to do with the tracker.
This means that if I set tracker probation age to 20 when my video runs at 1FPS, bounding boxes only start to appear after 20 seconds probably because it is not a valid object because it doesn’t have a valid ID yet. I think you can reproduce the problem setting probation age really high here. If the video your are using runs at X frames per second, set it to T * X where T is the probation age. Bounding boxes will only start to appear after T second of the video.