Issue with ROI Counting in DeepStream's NVAnalytics

• Hardware Platform - GPU
• DeepStream Version - 7.0
• TensorRT Version - 10.6.0
**• NVIDIA GPU Driver Version - 560.35.03 **
• Issue Type - questions
**• How to reproduce the issue ? **

Hello,

Currently, I’m working on video analytics using DeepStream. I have a question regarding NVAnalytics. Sometimes, certain objects—particularly those near the bottom of the image—are not counted in the ROI (Region of Interest) count. My understanding is that if the bottom-center point of an object’s bounding box lies within the ROI, the object should be considered inside the ROI. However, there are times when the object’s bottom vertex is inside the ROI, but it is still not counted.

Could you help explain why this happens? Below are some sample images for reference.

Additionally, here is my configuration file for the pgie:

[property]
gpu-id=0
net-scale-factor=0.00392156862745098
onnx-file=resnet34_peoplenet_int8.onnx
labelfile-path=labels.txt
model-engine-file=resnet34_peoplenet_int8.onnx_b3_gpu0_fp16.engine
int8-calib-file=resnet34_peoplenet_int8.txt
batch-size=24
process-mode=1
model-color-format=0

0=FP32, 1=INT8, 2=FP16 mode

network-mode=1
num-detected-classes=3
interval=0
gie-unique-id=1
#scaling-filter=0
#scaling-compute-hw=0
cluster-mode=2

[class-attrs-all]
pre-cluster-threshold=0.2
topk=2000
nms-iou-threshold=0.6

object id 40 and 19

Thanks for the sharing! can you using deepstream-nvdsanalytics-test to reproduce the issue? if so could you provide test videos and nvdsanalytics configuration file? Thanks!

Hi @fanzh ,

test video

analytics config :

[roi-filtering-stream-0]
enable=1
roi-demo=674;1080;1857;1080;1900;1080;1911;1054;1916;476;509;492;509;493;502;485
class-id=0
mode=balanced

the bottom of ROI and bbox of people 25 overlapped. Strictly speaking, the bottom of people 25 is not in the ROI. As the people 18 shown, the bottom-center is in the ROI.

Apologies for the confusion. For example, in the screenshot I attached above, both object IDs 40 and 19 have their bottom center points inside the ROI. However, NVAnalytics is returning that these objects are not part of the ROI. Could you please explain this in more detail? Thank you!

  1. seems the bottom of ROI and people 25 bbox overlapped. so the bottom-center point of people 25 bbox is on the boundary of ROI. do you mean “on the boundary of ROI” is also inside the ROI?

Hey for a example ,

I have defined my ROI as follows:

roi_points = [
    (674, 1080), (1857, 1080), (1900, 1080), (1911, 1054), 
    (1916, 476), (509, 492), (509, 493), (502, 485)
]

And I have two bounding boxes (bbox) from my NVAnalytics prob:

bbox_1 = [1560.563, 834.382, 316.093, 245.618]
bbox_2 = [1564.709, 802.906, 310.607, 277.094]

In my case, NVAnalytics returns that bbox_1 is not inside the ROI, while bbox_2 is inside the ROI. However, both bbox_1 and bbox_2 represent the same object from different frames. The issue I’m facing is that the bottom center point of bbox_1 is (1718.6096801757812, 1080.0) and the bottom center point of bbox_2 is (1720.012451171875, 1080.0). Both of these center points lie inside the ROI, so I’m confused as to why NVAnalytics returns one as inside the ROI and the other as not. Can you explain why this discrepancy occurs?

we are investigating this accuracy issue( the bottom-center point is close to ROI boundary). Currently the nvdsanalytic plugin is opensource and nvdsanalytic low-level lib is close-source. please refer to this topic for how to customize algorithm in plugin.

About the original issue, Here is a workaround. please change the bottom coordinate to a bigger value. it is because some actual center bottom points of bbox are outside of 1080.
roi_points = [
(674, 1110), (1857, 1110), (1900, 1110), (1911, 1054),
(1916, 476), (509, 492), (509, 493), (502, 485)
]