Cropping for PGIE

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Xavier AGX
• DeepStream Version 5.0.0
• JetPack Version (valid for Jetson only) 4.5
• TensorRT Version 7.1.3

Hello! I am trying to run nvinfer on panoramic image so I am trying to make a batch from 1 source by cropping into multiple square images. I was digging through the example source files but could not find anything useful. Can you suggest any resources for my use-case?

1 Like

One solution maybe you can add tee element to duplicated the source and then link to Gst-nvvideoconvert — DeepStream 6.1.1 Release documentation to crop the image you need.

Thank you for your suggestion!
In my limited understanding of GStreamer, I think that will cause a big performance bottleneck. Currently the original source will be 60fps 500x2000 and I plan to crop it into 6 images (some overlapping). So I will have to stream the 500x2000 at 60 fps with 6 sources. Do you think it will be fine?

Yeah, you are right, the perf will drop using this solution.
For another solution, just as you mentioned, you need to implement your own gstreamer pluin to do the optimized crop inside it.
dsexample is a reference and also here is a sample code to access the nvbufsurface Deepstream sample code snippet and api reference is here NVIDIA DeepStream SDK API Reference: Main Page

1 Like

@bcao Hello! I have been playing around with gst-dsexample but I am not sure how to construct a batch like nvstreammux since it is closed-source. Also, my output buffer size is expected to be larger than the input buffer so I have to use the transform callback. But I saw this Copy on content of input buffer to output buffer - #6 by DaneLLL. Is it still the case? And can you guide me on how to construct a batch?