Yolov5 run slow with python binding

Please provide complete information as applicable to your setup.

• Hardware Platform :Jetson Nano
*• DeepStream: 6.0
• JetPack Version: 4.6.1
• TensorRT Version: 8.2.1.8
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type: questions

Hi everyone I use this guide :

https://gist.github.com/bharath5673/800a18cc7474ce9c22fda6deaaa98354#comments

To run yolo5s on my jetson nano, When I run by the command:

deepstream-app -c deepstream_app_config.txt

I get result around 8.5 FPS

and when I try using binding in python I get very slow result I can’t understand why? of course I need to mention that I new with deepstream I learn this only this week and using python binding can very help me to my goals.

I add to short videos of the result I would be happy to any help thank you :)


from your screenshot, using python sample, the fps also is 8, what do you mean about “very slow result”?

Hi first thank you to reply, I didn’t understand how you see in the screenshot 8 fps maybe I miss something but in general, what I mean is that you can see that the video run more slowly on the screen when I use python binding, In addition, you can see in the video that I get in the terminal the message There may be timestamping problem or this computer is to slow. and pay attention to NVDEC there are different between videos.

from the second video, I can see the video is stuck, where did you get that deeptream-yolo.py? it is custom code? you can set sync=0 in [sink] configuration.

I get deepstream-yolo.py from the same git above, I use in the same configuration.txt so I really don’t understand what happen.

note (10.):

https://gist.github.com/bharath5673/800a18cc7474ce9c22fda6deaaa98354#comments

and when I run yolo-Tracker.py I get the same slow result absolutely I do something wrong maybe configuration or something like that I just need to figure out.

hi is this the configuration? Deepstream/deepstream_app_config_yolo.txt at main · bharath5673/Deepstream · GitHub
please set num-sources to 1, which is similar to C version 's configuration.

Hi sorry I despaired, I try to run my python code with your configuration (change num-source to 1) and get this error

Creating Pipeline 
 
Creating streamux 
 
Creating source_bin  0  
 
Creating source bin
source-bin-00
Creating Pgie 
 
Creating tiler 
 
Creating nvvidconv 
 
Creating nvosd 
 
Creating transform 
 
Creating EGLSink 

Could not find group property
** ERROR: <gst_nvinfer_parse_config_file:1303>: failed
Adding elements to Pipeline 

Linking elements in the Pipeline 

Now playing...
1 :  file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
Starting pipeline 


Using winsys: x11 
0:00:00.298257623 11860   0x558effe290 WARN                 nvinfer gstnvinfer.cpp:794:gst_nvinfer_start:<primary-inference> error: Configuration file parsing failed
0:00:00.298301739 11860   0x558effe290 WARN                 nvinfer gstnvinfer.cpp:794:gst_nvinfer_start:<primary-inference> error: Config file path: deepstream_app_config_yoloV5_check.txt
Error: gst-library-error-quark: Configuration file parsing failed (5): /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(794): gst_nvinfer_start (): /GstPipeline:pipeline0/GstNvInfer:primary-inference:
Config file path: deepstream_app_config_yoloV5_check.txt
Exiting app

In general I run my code with this configuration file:
config_infer_primary_yoloV5.txt (629 Bytes)

I am really sure that I do something wrong with the configuration and because of this I get a slow result I will be very happy if you can help me to figure it out.

** ERROR: <gst_nvinfer_parse_config_file:1303>: failed
here is an error, parsing configuration file failed, can you narrow down this issue? you can compare it with original file.

Ok I try to compare and not see really different still get error parsing when I use this configuration:
deepstream_app_config_yoloV5_check.txt (4.6 KB)

When I run yolo with the configuration:
config_infer_primary_yoloV5.txt (629 Bytes)
I don’t get parsing problem but my yolo run very slow like you see in the short video.
note that the parser error is: Could not find group property

There is some log or something that I can add to the original code to understand where is the parsing problem?
I control my jetson nano with remote ssh using pycharm and try to debug the problem but still can’t figure out what happened I came to the line code
pgie.set_property('config-file-path', "deepstream_app_config_yoloV5_check.txt")
and just get the error parsing it’s difficult to understand where it falls and I try to compare it to another deepstream-config.txt it seems to me ok.

The solution is from your forum I have a problem of dropped frames.

https://forums.developer.nvidia.com/t/error-a-lot-of-buffers-are-being-dropped-when-running-ds-sdk-python-sample-ipcamera-on-nano/110886/5

Hi,
Please apply the modification to deepstream_test_3.py and try again.
1 set ‘live-source=1’ to streammux

streammux.set_property('live-source', 1)

2 Replace nveglglesink with nvoverlaysink and set ‘sync=0’

- transform=Gst.ElementFactory.make("nvegltransform", "nvegl-transform")
+ transform=Gst.ElementFactory.make("queue", "queue")
- sink = Gst.ElementFactory.make("nveglglessink", "nvvideo-renderer")
+ sink = Gst.ElementFactory.make("nvoverlaysink", "nvvideo-renderer")
+ sink.set_property('sync', 0)

3 Apply the setting of Nano to config file
https://devtalk.nvidia.com/default/topic/1058597/deepstream-sdk/-nano-deepstream-test3-app-not-working-as-expected-for-multiple-video-source/post/5368352/#5368352

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