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

**URL:** <https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007>\
**Category:** DeepStream SDK\
**Created:** [September 9, 2020, 4:38pm UTC](https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007 "2020-09-09T16:38:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [September 9, 2020, 4:38pm UTC](https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007/1 "2020-09-09T16:38:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bcao](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/bcao/32/14043_2.png) [@bcao](https://forums.developer.nvidia.com/u/bcao)\
**Post date:** [September 13, 2020, 1:57pm UTC](https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007/3 "2020-09-13T13:57:54Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [September 14, 2020, 8:38am UTC](https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007/4 "2020-09-14T08:38:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [September 17, 2020, 6:07am UTC](https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007/5 "2020-09-17T06:07:46Z")

</div>

@bcao anything on this?

---

<div class="post-metadata">

**Author:** ![bcao](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/bcao/32/14043_2.png) [@bcao](https://forums.developer.nvidia.com/u/bcao)\
**Post date:** [September 17, 2020, 6:21am UTC](https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007/6 "2020-09-17T06:21:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:16pm UTC](https://forums.developer.nvidia.com/t/how-to-run-classifier-in-primary-mode-only-in-specific-roi/154007/8 "2021-10-12T16:16:34Z")

</div>


