How to run classifier in primary mode only in specific ROI?

I’m right now using both DS5 and DS4. I was trying to run classifier in primary mode only on specific parts of the input frame. Is there any way that this could be achieved. I wouldn’t mind modifying the source code of nvinfer if it’s doable. Any pointers would help.

The requirement would be let’s say we have 2-3 regions on which we need to crop and run classifier on these cropped segments.

Any help would be appreciated. Thanks.

You mean make nvinfer work on primary mode and secondary mode and the mode can be switched in runtime?
BTW, could you share your setup?

Not exactly run time switching of primary and seconday, but I just want to run my classifier in a specific portion of a frame all the time right now classifier runs on bbox of primary detector or on full frame, but what I would like to do is have a frame and define bounding box which are fixed always and input them to classifier. I’m not sure which mode the classifier fits into but it’s mostly running without a detector but inferencing only on specific regions in the image.

@bcao anything on this?

Currently we support classifier as primary mode, but we don’t support specifying ROI if it work as that mode.
Maybe you can add a nvvideoconvert plugin before nvinfer to crop the specific ROI