DeepStream-Yolo icon indicating copy to clipboard operation
DeepStream-Yolo copied to clipboard

Inference limited to 60FPS with YOLOv5n on Jetson Xavier NX

Open lakshanthad opened this issue 1 year ago • 6 comments

Hello,

I am having a problem at getting limited FPS results running YOLOv5n on Jetson Xavier NX. The inference is run on the default video file provided in the deepstream config. Also, Xavier NX is running at 20W 6CORE mode.

What worked:

  1. Download YOLOv5n model
  2. Convert model using default inference size (640)
  3. Follow the rest of the steps in https://github.com/marcoslucianops/DeepStream-Yolo/tree/master/docs/YOLOv5.md
  4. FInally, the inference is about 60FPS

What did not work:

  1. Download YOLOv5n model
  2. Convert model using default inference size (320)
  3. Follow the rest of the steps in https://github.com/marcoslucianops/DeepStream-Yolo/tree/master/docs/YOLOv5.md
  4. FInally, the inference is about 60FPS

So as you can see, the inference performance for both 320 and 640 inference sizes is 60FPS which is weird. Does anyone know why? No matter how I go low in inference size, the FPS stays at 60FPS.

Appreciate any help!

lakshanthad avatar Aug 25 '22 08:08 lakshanthad

Set [sink] sync=0 in the deepstream_app_config.txt file.

marcoslucianops avatar Aug 25 '22 22:08 marcoslucianops

Thank you for the response @marcoslucianops

I am using the default values under [sink] inside deepstream_app_config.txt file which has sync=0 set already.

lakshanthad avatar Aug 26 '22 02:08 lakshanthad

What is your source ?

Arpit1496 avatar Sep 07 '22 20:09 Arpit1496

When using [sink] type=2, the framerate is limited to the monitor Hz. You should use [sink] type=1 to get the maximum framerate.

marcoslucianops avatar Sep 23 '22 13:09 marcoslucianops

What is your source ?

@Arpit1496 My source is default one provided: file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4

lakshanthad avatar Sep 23 '22 15:09 lakshanthad

When using [sink] type=2, the framerate is limited to the monitor Hz. You should use [sink] type=1 to get the maximum framerate.

@marcoslucianops Thank you for this. I will try again and share the results here.

lakshanthad avatar Sep 23 '22 15:09 lakshanthad

Hi @marcoslucianops,

When I set [sink] type=1, there is no video preview output. It just shows the inference results on the terminal. Any idea why?

However, the FPS on the terminal shows a higher value at least.

I also tried running with DISPLAY=:0 deepstream-app -c deepstream_app_config.txt, but no luck.

lakshanthad avatar Sep 24 '22 05:09 lakshanthad

Hello @lakshanthad, The [sink] type=1 working on fakesink mode. This closes the video streaming. That's why, it increases the FPS.

You can check the other types from here: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_ref_app_deepstream.html#sink-group

mdeniz0 avatar Sep 24 '22 08:09 mdeniz0

Thank you @mdeniz0 for the clarification. So if I want to obtain a video stream without the limitation of the FPS of the monitor, what could be the best way to achieve it?

lakshanthad avatar Sep 24 '22 09:09 lakshanthad

As @marcoslucianops said that, the [sink] sync=0 setting will work in without FPS limitation.

mdeniz0 avatar Sep 26 '22 06:09 mdeniz0

@mdeniz0 Yeah, that's clear. I mean I want an output video stream (including object detection ) without FPS limitation. with sync=0, there is no video output window.

lakshanthad avatar Sep 26 '22 06:09 lakshanthad

With nveglglessink window output it's not possible to get more than 60 FPS even using sync=0. It's limited to screen refresh rate.

marcoslucianops avatar Oct 17 '22 12:10 marcoslucianops