Add padding to bounding box before secondary inference in python

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) dGPU
• DeepStream Version 6.1
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only) RTX2080Ti
• 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’m using 2 models in deepstream python binding for primary inference and secondary inference.
I need to add padding to the bounding boxes detected in primary inference before bringing them to secondary inference. I found some code in see C language but I don’t know how to use this in python. Please help me.


This is code I found

You can refer this to get the related structures:

Thanks, I will try and reply to you

Hello @ttrungtin2910 Do you still need support for this topic? Or should we close it? Thanks.

I still need support, please don’t close this topic, I have just learn about deepstream and python so I am slowly understanding. Thanks

No problem, take your time.

I mean scaling up the bounding box before bringing it to secondary inference, not adding padding to the video

Do you want to just scaling up the boundary of the bounding box or the picture of the bounding box?

No, I just want to scale up the boundary of the bounding box. Because some BB is not include all part of object before bring them to secondary inference

You can try to get the coordinate of bbox by probe function of the pgie and reset them by yourself.

I can get the coordinate of bbox by probe function of the pgie, Please guide me reset them and bring them to secondary inference

You can get the coordinate from the pgie probe function, just reset it by yourself. Then send the new coordinate to the sgie.Like below:

  (100,100) -> (50, 50)
  (100,200) -> (50, 300)
  (200,100) -> (300, 50)
  (200,200) -> (300, 300)

Thank you for your help, I will try

Yes, I can do this
Thank you so much

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