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.46k stars 355 forks source link

RTSP Stream issues - YOLOV8 #562

Closed jvd-monteiro closed 1 month ago

jvd-monteiro commented 1 month ago

Hello,

I'm currently running a yolov8s model trained with an imgsize of 1080 on a Jetson Orin Nano (8GB, Jetpack 6.0, Deepstream 7.0). When running, cameras fps performance are as shown: **PERF: 22.05 (20.45) 14.85 (15.58) 12.02 (12.46) 12.02 (12.41) 12.02 (12.40)

Not really sure why they vary so much, but my main issue is that the image from the camera running at 20fps is lagged/blurry/ghostlike. Other ones are fine... Any suggestions on improvements? The batch definition and syncronization are topics that are still not clear to me. Thank you in advance for any help!

Details:

I've exported the yolo model to .onnx with: python3 utils/export_yoloV8.py -w yolov8s.pt --opset 12 --dynamic

Configured the file to create the engine with the settings below:

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
onnx-file=yolov8s.onnx
model-engine-file=model_b1_gpu0_fp16.engine
#int8-calib-file=calib.table
labelfile-path=labels.txt
batch-size=1
network-mode=2
num-detected-classes=8
interval=0
gie-unique-id=1
process-mode=1
network-type=2
cluster-mode=2
maintain-aspect-ratio=1
symmetric-padding=1
#workspace-size=2000
parse-bbox-func-name=NvDsInferParseYolo
#parse-bbox-func-name=NvDsInferParseYoloCuda
custom-lib-path=nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
engine-create-func-name=NvDsInferYoloCudaEngineGet

[class-attrs-all]
nms-iou-threshold=0.45
pre-cluster-threshold=0.15
topk=300

And set my deepstream_app_config file as:

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5

[tiled-display]
enable=1
rows=2
columns=3
width=1280
height=720
gpu-id=0
nvbuf-memory-type=0

[source0]
enable=1
type=4
uri=rtsp://admin:1960@192.168.3.242/cam/realmonitor?channel=1&subtype=0
num-sources=1
gpu-id=0
cudadec-memtype=0

[source1]
enable=1
type=4
uri=rtsp://admin:1960@192.168.3.242/cam/realmonitor?channel=2&subtype=0
num-sources=1
gpu-id=0
cudadec-memtype=0

[source2]
enable=1
type=4
uri=rtsp://admin:1960@192.168.3.242/cam/realmonitor?channel=3&subtype=0
num-sources=1
gpu-id=0
cudadec-memtype=0

[source3]
enable=1
type=4
uri=rtsp://admin:1960@192.168.3.242/cam/realmonitor?channel=4&subtype=0
num-sources=1
gpu-id=0
cudadec-memtype=0

[source4]
enable=1
type=4
uri=rtsp://admin:1960@192.168.3.242/cam/realmonitor?channel=5&subtype=0
num-sources=1
gpu-id=0
cudadec-memtype=0

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

[osd]
enable=1
gpu-id=0
border-width=5
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=1
batch-size=5
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
config-file=config_infer_primary_yoloV8.txt

[tests]
file-loop=0

And running: deepstream-app -c deepstream_app_config.txt

jvd-monteiro commented 1 month ago

Using drop-frame-interval=2 brought the fps to 15fps and apparently did the trick, image seems stable now...

Any further comments or suggestions?