How to draw circles on deepstream with python bindings?

• Hardware Platform (Jetson / GPU)
Jetson Xavier NX
• DeepStream Version
DeepStream 6.0
• JetPack Version (valid for Jetson only)
4.6.1-b110
• TensorRT Version
8.2.1.8

I am trying to draw centroid marker on the display from DeepStream with python bindings. I assume pyds.NvOSD_CircleParams class can be used for the purpose. However I am not sure how to use this in the program… Could anyone show me a sample code for drawing?

Similar way to getting display_meta from batch_meta as the way in deepstream_test_1.py, then getting circle_params from display_meta, and then you can set the circle-related parameters as defined in pyds.NvOSD_CircleParams class.

@yingliu Thank you very much. I tried with the code,

display_meta=pyds.nvds_acquire_display_meta_from_pool(batch_meta)
for ppl_location in ppl_locations:
    print(ppl_location)
    display_meta.circle_params.xc = ppl_location[0]
    display_meta.circle_params.yc = ppl_location[1]
    display_meta.circle_params.radius = 10
    display_meta.circle_params.circle_color.set(1.0, 1.0, 1.0, 1.0)

and got an error: AttributeError: “list” object has no attribute ‘xc’

I am sorry for asking this very beginner thing, but I am pleased if you point out what is wrong with my code.

You can refer the way to access text parameter from deepstream_test_1.py, seems you missed step 2 as below:

display_meta=pyds.nvds_acquire_display_meta_from_pool(batch_meta)
py_nvosd_text_params = display_meta.text_params[0]
py_nvosd_text_params.x_offset = 10

@yingliu thank you so much for your advice. I succeeded in drawing!

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