Can nvdspreprocess custom lib set properies for multiple times like nvdsvideotemplate

Following this question about customizing nvdspreprocessor, I want to make the customized nvdspreprocessor accept config from external source like postgres database, in order to set up the blacked out area of polygon shape. I am wondering whether there is similar function to nvdsvideotemplate where Custom Library Properties (key:value) string can be set multiple times so that the polygon area can be blacked out dynamically following the updates on postgres.

As you customized the preprocess library, is it possible query the polygon area from the database in your customized preprocess library? Can you share more details of the use case? How you decide the polygon area need to black out?

Yeah it can grab the polygon settings from the library. You can think of the use case as customized ROI (region of interest) as opposed to the default one of rectangular shape. The reason we want to implement this funcionality is in reality the region of interest can be of any shape instead of only rectangle in order to capture the objects. For example in the screenshot I uploaded here, I want to black out the triangular area at the bottom left so that the model only needs to be run on the rest of the frame, otherwise if the blacked out area contains too many objects it will add unnecessary workload to Jetson to detect and track these objects.

But why you need change the polygon dynamically?

Becuase the ROI varies from location to location, and even needs to be changed if the camera is zoomed in or out for a bit. In this way, we can scale up the deployment easily instead of hardcoding the config files for different locations. But nevertheless, if it is hard to modify the ROI config dynamically, how can we set up the polygon ROI config in the static cofig_preprocess.txt file. Supposedly, the polygon shape shall be taken as input by the ConvertFcn function in the nvdspreprocess_impl.cpp.

NVDSPREPROCESS plugin seems to be not as flexible as NVDSVIDEOTEMPLATE in which Custom Library Properties (key:value) string, can be set multiple times. I am thinking of how much change I need to make for NVDSPREPROCESS to accomendate the customization.

Can you share the pipeline of your use case? PGIE will process on the whole image even if you black out it. SGIE will process the object which detected by PGIE.

For now we only consider PGIE. The only functionality we want to achieve is the customized ROI shape in the nvdspreprocess plugin, I believe the default one only supports rectangular ROI?

Yes, nvdspreprocess only support rectangular ROI. Seems there isn’t any MMJ microservice in your use case. Do you agree to move this topic to DeepStream for better visibility?

1 Like

sure sounds good!

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