Increase pyds.NvDsDisplayMeta.num_circles to visualize circles

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.1
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only) 510
• Issue Type( questions, new requirements, bugs) question

Hi, I’m trying to visualize circles with pyds.NvDsDisplayMeta along with its num_circles and circle_params attributes. I read the post DEEPSTREAM 5.0 draw circles, and I tried to implement an equivalent python implementation:

frame_object_list = nvds_infer_parse_custom(layers_info)
display_meta = pyds.nvds_acquire_display_meta_from_pool(batch_meta)
display_meta.num_circles = len(frame_object_list)

for idx, frame_object in enumerate(frame_object_list):
    circle_params = display_meta.circle_params[idx]
    # circle_params = pyds.NvOSD_CircleParams()
    circle_params.xc = int(frame_object.left)
    circle_params.yc = int(
    circle_params.radius = 100
    circle_params.circle_color.set(1, 0, 0, 1)
    circle_params.has_bg_color = True
    circle_params.bg_color.set(1, 0, 0, 1)

However, it seems that even I set display_meta.num_circles = len(frame_object_list) before manipulating display_meta.circle_params[idx], it still cannot work. In this way, it is successful for the first 16th frame_object but it cannot work for the 17th+ frame_object with an error of IndexError. I tried to print len(display_meta.circle_params) before and after I set display_meta.num_circles = len(frame_object_list), and it is always equal to 16. So, I am considering whether there is anyway to increase the len of display_meta.circle_params to be larger than 16 so that I can add more circles. Do you have any idea?

The size of array circle_params in NvDsDisplayMeta is defined as 16, that’s why the IndexError happens. you can refer the definition in deepstream/sources/includes/nvdsmeta.h

1 Like

Thank you for your answer, however, I think it would be better to increase the MAX_ELEMENTS_IN_DISPLAY_META to be larger than 16 in case there are more than 16 circles in a displaymeta. Is it possible to do this in python? Until now, I have to create 1000 DisplayMeta when I have 1000 circles (1 circle for each DisplayMeta), which would be really inefficient.

Hi @hoangtnm.cse , we don’t limit the number of circles, the display_meta.circle_params are the parameters to draw a circle. For circle, you only need a coordinate array, a circumference number. 16 is enough for this. Thanks

There is no update from you for a period, assuming this is not an issue anymore.
Hence we are closing this topic. If need further support, please open a new one.

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