DeepStream limiting number of bounding boxes per frame.

I only have one class. I am using a detector model. I am getting multiple bounding boxes for a single class per frame. But I want to draw a single bounding box per frame which has the maximum confidence value.

Not very clear about your question. Are you using your detector model with deepstream-app, I think you need to customize the output parser function if yes.

No. We did transfer learning using nvidia transfer learning toolkit to train mobilenet_v2. In inference we are getting multiple bounding boxes for a single image. But we just one bounding box which has the maximum confidence.

Got it, checking internally.

BTW, would you mind to share your config files with us?
Also let me know is the issue exist if you use the original model?

Problem is in original model too. If there is three bicycles in a frame bounding boxes are drawn for all three but we only want to draw one bounding box on the bicycle which has the most confidence value.

Here is my config files.

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=1
rows=1
columns=1
width=1920
height=1080

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=2
uri=myvideofile.mp4
num-sources=1
drop-frame-interval=0
#camera-width=1920
#camera-height=1080
#camera-fps-n=30
#camera-v4l2-dev-node=0
#camera-id=1
#camera-fps-d=1
gpu-id=0
# (0): memtype_device   - Memory type Devqice
# (1): memtype_pinned   - Memory type Host Pinned
# (2): memtype_unified  - Memory type Unified
cudadec-memtype=2

[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming 5=Overlay
type=5
sync=0
display-id=0
offset-x=0
offset-y=0
width=0
height=0
overlay-id=1
source-id=0

[sink1]
enable=1
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265 3=mpeg4
codec=1
sync=0
bitrate=2000000
output-file=outA.mp4
source-id=0

[sink2]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming 5=Overlay
type=4
#1=h264 2=h265
codec=1
sync=0
bitrate=4000000
# set below properties in case of RTSPStreaming
rtsp-port=8554
udp-port=5400

[osd]
enable=1
border-width=4
text-size=12
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0

[streammux]
##Boolean property to inform muxer that sources are live
live-source=0
batch-size=1
##time out in usec, to wait after the first buffer is available
##to push the batch even if the complete batch is not formed
batched-push-timeout=40000
## Set muxer output width and height
width=1920
height=1080

# config-file property is mandatory for any gie section.
# Other properties are optional and if set will override the properties set in
# the infer config file.
[primary-gie]
enable=1
#model-engine-file=INT8_m1.plan
model-engine-file=smchyd_demo_model.etlt_b1_fp16.plan
batch-size=1
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
interval=0
#Required by the app for SGIE, when used along with config-file property
gie-unique-id=1
config-file=primary_inference.txt

[tests]
file-loop=0

[tracker]
enable=0
tracker-width=512
tracker-height=128
#ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_iou.so
#ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_nvdcf.so
ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
#ll-config-file required for DCF/IOU only
#ll-config-file=tracker_config.yml
#ll-config-file=iou_config.txt
gpu-id=0
#enable-batch-process applicable to DCF only
enable-batch-process=1

####primary_inference.txt

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
#model-engine-file=INT8_m1.plan
model-engine-file=smchyd_demo_model.etlt_b1_fp16.plan

labelfile-path=labels.txt
#int8-calib-file=calibration.bin
uff-input-blob-name=input_1
batch-size=1
input-dims=3;128;512;0
process-mode=1
model-color-format=0
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=2
num-detected-classes=1
interval=0
#network-type=1
gie-unique-id=1
output-blob-names=output_cov/Sigmoid;output_bbox/BiasAdd
is-classifier=0
#parse-bbox-func-name=parse_bbox_custom_resnet
#parse-bbox-lib-name=/usr/local/deepstream/libnvparsebbox.so


tlt-encoded-model=smchyd_demo_model.etlt
tlt-model-key=<my key>
uff-input-dims=3;128;512;0
uff-input-blob-name=input_1



[class-attrs-all]
threshold=0.2
group-threshold=1

## Set eps=0.7 and minBoxes for enable-dbscan=1
eps=0.2
minBoxes=0
roi-top-offset=0
roi-bottom-offset=0
detected-min-w=0
detected-min-h=0
detected-max-w=0
detected-max-h=0

## Per class configuration
#[class-attrs-0]
#threshold=0.3
#eps=0.2
#group-threshold=1
#roi-top-offset=0
#roi-bottom-offset=0
#detected-min-w=0
#detected-min-h=0
#detected-max-w=0
#detected-max-h=0

This is currently not possible in nvinfer, it’s an enchancement and we will add the support in later release.

Hi muhammad.abdussab,

I thought you can do it by do customize on

#parse-bbox-func-name=parse_bbox_custom_resnet
#parse-bbox-lib-name=/usr/local/deepstream/libnvparsebbox.so

in there you can get output of boxes and sort confident then get only one maximum confident add to object list.