marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.45k stars 356 forks source link

Add secondary gie. #457

Closed emad555 closed 1 year ago

emad555 commented 1 year ago

I have added a secondary gie as a classifier as follow:

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
gie-kitti-output-dir=/opt/nvidia/deepstream/deepstream-6.0/DeepStream-Yolo/kitti
#kitti-track-output-dir=/opt/nvidia/deepstream/deepstream-6.0/DeepStream-Yolo/kitti2

[tiled-display]
enable=1
rows=1
columns=1  # Set to 1 column for video streaming only
width=1280
height=720
gpu-id=0
nvbuf-memory-type=0

[source0]
enable=1
type=3
uri=file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_1080p_h264.mp4
#uri=file:///opt/nvidia/deepstream/deepstream-6.0/DeepStream-Yolo/IR.mp4
num-sources=1
gpu-id=0
cudadec-memtype=0

[sink0]
enable=1
type=2
sync=0
gpu-id=0
nvbuf-memory-type=0
overlay-id=1

[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=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

[streammux]
gpu-id=0
live-source=0
batch-size=1
batched-push-timeout=40000
width=1920
height=1080
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
gie-unique-id=1
nvbuf-memory-type=0
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
config-file=config_infer_primary.txt

[secondary-gie0]
enable=1
model-engine-file=/opt/nvidia/deepstream/deepstream-6.0/samples/models/Secondary_CarColor/resnet18.caffemodel_b1_gpu0_fp16.engine
batch-size=4
gpu-id=0
gie-unique-id=5
operate-on-gie-id=1
operate-on-class-ids=2
config-file=/opt/nvidia/deepstream/deepstream-6.0/samples/configs/deepstream-app/config_infer_secondary_carcolor.txt

[tests]
file-loop=0

The output when I run deepstrem-app is the same without the classifier, should I edit the source code to display the results of the classifier?

How to make sure it is working?

emad555 commented 1 year ago

solved by adding a tracker before the classifier:

[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=384
ll-lib-file=/opt/nvidia/deepstream/deepstream-6.0/lib/libnvds_nvmultiobjecttracker.so
# ll-config-file required to set different tracker types
# ll-config-file=../../../../../samples/configs/deepstream-app/config_tracker_IOU.yml
ll-config-file=../../../../../samples/configs/deepstream-app/config_tracker_NvDCF_perf.yml
# ll-config-file=../../../../../samples/configs/deepstream-app/config_tracker_NvDCF_accuracy.yml
# ll-config-file=../../../../../samples/configs/deepstream-app/config_tracker_DeepSORT.yml
gpu-id=0
enable-batch-process=1
enable-past-frame=1
display-tracking-id=1