Nvds-analytics doesn't display DIR:

• Hardware Platform (Jetson / GPU)
x86-64 Ubuntu 20.04 LTS machine with Geforce GTX 3060
• DeepStream Version
6.1.0
• TensorRT Version
8.2.5.1
• NVIDIA GPU Driver Version (valid for GPU only)
515.48.07
• Issue Type( questions, new requirements, bugs)
I try to add nvds-analytics group in deepstream-sdk, the configuration is almost the same as deepstream-nvdsanalytics-test demo, and it can counts all crossing adherence to direction successfully,but it doesn’t show DIR:north as the demo did,the configuration as below:
[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
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=3
uri=file://sample_1080p_h265.mp4
num-sources=1
gpu-id=0
cudadec-memtype=0

#显示界面
[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File
type=2

0表示越快越好 1表示同步

sync=0
source-id=0
gpu-id=0
nvbuf-memory-type=0
#1=mp4 2=mkv
container=1
#1=h264 2=h265
codec=1
output-file=yolov5.mp4

[sink1]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming
type=4
source-id=1
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
bitrate=4000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0

set below properties in case of RTSPStreaming

rtsp-port=8554
udp-port=5400

#显示 目标框
[osd]
enable=1
gpu-id=0
border-width=1
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
nvbuf-memory-type=0
display-text = 1
display-bbox = 1
display-mask = 1

[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=1
batch-size=20
##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

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
gpu-id=0
batch-size=20
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
interval=0
gie-unique-id=1
nvbuf-memory-type=0
config-file=dstest2_pgie_config.txt

[secondary-gie0]
enable=0
gpu-id=0
#model-engine-file=My_CarType/resnet18.engine
#labelfile-path=My_CarType/labels.txt
model-engine-file=Secondary_CarColor/resnet18.caffemodel_b16_gpu0_int8.engine
labelfile-path=Secondary_CarColor/labels.txt
batch-size=20
gie-unique-id=2
operate-on-gie-id=1
operate-on-class-ids=2
nvbuf-memory-type=0
config-file=dstest2_sgie1_config.txt

[tracker]
enable=1

For NvDCF and DeepSORT tracker, tracker-width and tracker-height must be a multiple of 32, respectively

tracker-width=640
tracker-height=480
ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so

ll-config-file required to set different tracker types

ll-config-file=config_tracker_IOU.yml

ll-config-file=config_tracker_NvDCF_perf.yml

ll-config-file=config_tracker_NvDCF_accuracy.yml

ll-config-file=config_tracker_DeepSORT.yml

gpu-id=0
enable-batch-process=1
enable-past-frame=0
display-tracking-id=1

[nvds-analytics]
enable=1
config-file=config_nvdsanalytics.txt

[tests]
file-loop=0

the configuration of config_nvdsanalytics.txt as below:
################################################################################

Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a

copy of this software and associated documentation files (the “Software”),

to deal in the Software without restriction, including without limitation

the rights to use, copy, modify, merge, publish, distribute, sublicense,

and/or sell copies of the Software, and to permit persons to whom the

Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

DEALINGS IN THE SOFTWARE.

################################################################################

The values in the config file are overridden by values set through GObject

properties.

[property]
enable=1
#Width height used for configuration to which below configs are configured
config-width=1920
config-height=1080
#osd-mode 0: Dont display any lines, rois and text

1: Display only lines, rois and static text i.e. labels

2: Display all info from 1 plus information about counts

#osd-mode=2
#Set OSD font size that has to be displayed
display-font-size=12

Per stream configuration

[roi-filtering-stream-0]
#enable or disable following feature
enable=1
#ROI to filter select objects, and remove from meta data
roi-RF=295;643;579;634;642;913;56;828
#remove objects in the ROI
inverse-roi=0
class-id=-1

Per stream configuration

[roi-filtering-stream-2]
#enable or disable following feature
enable=1
#ROI to filter select objects, and remove from meta data
roi-RF=295;643;579;634;642;913;56;828
#remove objects in the ROI
inverse-roi=1
class-id=0

[overcrowding-stream-1]
enable=1
roi-OC=295;643;579;634;642;913;56;828
#no of objects that will trigger OC
object-threshold=3
class-id=-1

[line-crossing-stream-0]
enable=1
#Label;direction;lc
#line-crossing-Entry=1072;911;1143;1058;944;1020;1297;1020;
line-crossing-Exit=789;672;1084;900;851;773;1203;732
class-id=2
#extended when 0- only counts crossing on the configured Line

1- assumes extended Line crossing counts all the crossing

extended=0
#LC modes supported:
#loose : counts all crossing without strong adherence to direction
#balanced: Strict direction adherence expected compared to mode=loose
#strict : Strict direction adherence expected compared to mode=balanced
mode=loose

[direction-detection-stream-0]
enable=1
#Label;direction;
direction-South=284;840;360;662;
direction-North=1106;622;1312;701;
class-id=2

line-crossing only support one label, it can add direction information, like this:
line-crossing-N2SExit=789;672;1084;900;851;773;1203;732

I change line-crossing-Exit=789;672;1084;900;851;773;1203;732 to line-crossing-N2SExit=789;672;1084;900;851;773;1203;732, but it didn’t works, and what’s the meaning of “line-crossing only support one label”, and I only use one label class id =2,which is ID of car

I mean the label will show “N2SExit=” if set " line-crossing-N2SExit=“, what does " it didn’t works” means? what is your expecting?


I expect to see the DIR:north together with the label just like the demo does, but there is no dir-info displaying


you want to add a “North” label for direction arrow? “N2S” means from north to south, it can give direction information.


just like this pictures did,there is DIR:north displaying on top of detection boxs

“class-id=2” is Person classification, please set it to 0 if want to analyze cars, here is label file:/opt/nvidia/deepstream/deepstream/samples/models/Primary_Detector/labels.txt

in my data,class-id=2 mean car, no matter it’s car or person,there should be direction detection result displaying on top of detection bounding boxes, but it didn’t happened

  1. could you share your terminal logs? you can redirect it to a file.
  2. will it show direction information if setting class-id=-1 in [direction-detection-stream-0]?

log.txt (1.3 MB)

please help to analyze the log downloaded

in your logs, there are many stream id, my log only has one stream id 0.
please set batch-size to 1.

log.txxt (174.4 KB)

is the result ok now? from the log ,there already have direction information, like this: object 1 moving in North

it have direction information in the log, but the didn’t have direction detection result displaying on top of detection bounding boxes int the video, is there a parameter control displaying or not?

please set osd-mode=2, you can find it in this link: Gst-nvdsanalytics — DeepStream 6.1.1 Release documentation

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.