How to generate fake Boxes metadata in custom gstreamer plugin with pyds?

• Hardware Platform (Jetson / GPU) : Jetson
• DeepStream Version : 5.1
• JetPack Version (valid for Jetson only) : 4.5
• TensorRT Version : 7.1.3

Firstly, I have a question:
When two nvinfer element are stacked. The first and second nvinfer elements are pgie and sgie respectively.
Q: When the pgie-nvinfer detect objects and generate boxes for those then the boxes metadata are created. So the sgie-nvinfer receives the boxes and crops objects from frames? or the pgie crops the objects and sgie-nvinfer use patches of cropped for doing inference?

I want to write a custom plugin to generate fake car/vehicle bounding boxes metadata and the append to buffer for processing the next element(sgie-nvinfer).

The pgie-nvinfer is trafficcamnet model, I want to generate fake boxes of this model for next element(sgie-nvinfer)

Yes. PGIE detect objects and generate object meta with bbox information.SGIE get the object meta and crop the object images from video and do the inference.

There is sample plugin gst-dsexample source code in /opt/nvidia/deepstream/deepstream/sources/gst-pluins/gst-dsexample. The code of generating object meta is in attach_metadata_full_frame() function.

Please read the document and source code carefully and make sure you are already familiar with gstreamer.