Change bounding box color in Deepstream test app 5

Hi,
How can an I change bounding box color according to secondary classificatiob type in Deepstream4.0.1 test app 5?
Suppose, if Person Gender Male is detected, I want the bounding box to be in blue color; if female then red.

You can set the color by setting config “bbox-border-color” if u’r using deepstream-app, and the for ds-test5 you need to change the source code referring the deepstream-app code. referring deepstream_config_file_parser.c->parse_gie to look into the logic for handling CONFIG_GROUP_GIE_BBOX_BORDER_COLOR)

Could you please provide more insights on the logic side, Since I see colour of bounding box is changing based on the primary detector, where I would like to change based on secondary detector.

And in documentation it says bbox-border-color works for both primary & secondary detector:

Link:

https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream%20Development%20Guide%2Fdeepstream_app_config.3.2.html%23wwpID0E0AB0HA

https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream%2520Development%2520Guide%2Fdeepstream_app_config.3.2.html%23wwpID0E0AB0HA

And in documentation it says bbox-border-color works for both primary & secondary detector:
referring doc:
Primary GIE and Secondary GIE Group
The DeepStream application supports multiple secondary GIEs. For each secondary GIE, a separate group with the name secondary-gie%d must be added to the configuration file. For example:

BTW, pls share your config file with us if it still cannot work.

Hi shweta.u.shettar,

Have you managed to get it working?
Or please share your config file with us if it still cannot work.

Thanks

# Copyright (c) 2018 NVIDIA Corporation.  All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.

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

[tiled-display]
enable=1
rows=1
columns=3
width=1280
height=720
gpu-id=0
#(0): nvbuf-mem-default - Default memory allocated, specific to particular platform
#(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory, applicable for Tesla
#(2): nvbuf-mem-cuda-device - Allocate Device cuda memory, applicable for Tesla
#(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory, applicable for Tesla
#(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=3
uri=file://../../../../../samples/streams/cam3.mp4
num-sources=1
gpu-id=0
nvbuf-memory-type=0

[source1]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=3
uri=file://../../../../../samples/streams/cam4.mp4
num-sources=1
gpu-id=0
nvbuf-memory-type=0

[source2]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=3
uri=file://../../../../../samples/streams/cam6.mp4
num-sources=1
gpu-id=0
nvbuf-memory-type=0

[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File
type=2
sync=1
source-id=0
gpu-id=0
nvbuf-memory-type=0

[sink1]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=UDPSink 5=nvoverlaysink 6=MsgConvBroker
type=6
msg-conv-config=dstest5_msgconv_sample_config.txt
#(0): PAYLOAD_DEEPSTREAM - Deepstream schema payload
#(1): PAYLOAD_DEEPSTREAM_MINIMAL - Deepstream schema payload minimal
#(256): PAYLOAD_RESERVED - Reserved type
#(257): PAYLOAD_CUSTOM   - Custom schema payload
msg-conv-payload-type=0
msg-broker-proto-lib=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_kafka_proto.so
msg-broker-conn-str=xxx
topic=xxx
#Optional:
#msg-broker-config=../../deepstream-test4/cfg_kafka.txt

[osd]
enable=1
gpu-id=0
border-width=1
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Arial
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=0
batch-size=4
##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
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
batch-size=4
## 0=FP32, 1=INT8, 2=FP16 mode
nvbuf-memory-type=0
interval=0
gie-unique-id=1
model-engine-file=../../../../../samples/models/Primary_Detector/resnet10.caffemodel_b4_int8.engine
labelfile-path=../../../../../samples/models/Primary_Detector/labels.txt
config-file=../../../../../samples/configs/deepstream-app/config_infer_primary.txt
#infer-raw-output-dir=../../../../../samples/primary_detector_raw_output/

[tracker]
enable=1
tracker-width=600
tracker-height=300
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=0

[secondary-gie0]
enable=1
model-engine-file=../../../../../samples/models/Secondary_PersonGender/final_model.engine
batch-size=64
bbox-border-color0=1;0;0;1   #GENDER-MALE COLOR
bbox-border-color1=0;1;1;1   #GENDER-FEMALE COLOR
gpu-id=0
gie-unique-id=4
operate-on-gie-id=1
operate-on-class-ids=2;
config-file=../../../../../samples/configs/deepstream-app/config_infer_secondary_persongender.txt

[tests]
file-loop=1

May I know what is your secondary model output and would you mind to share your code and your config files with me.

Regarding your private message,
To change bbox color based on secondary results, u can modify nvinfer code where after secondary inference u can set bbox color in metadata. From config file you can set PGIE results bbox color

Or u can add probe at the src pad of nvinfer and iterate over metadata , find secondary results and based on your requirement change bbox color