Deepstream Yolov5 Benchmark on NVIDIA® Jetson™ & Xavier™ NX

Deepstream Yolov5 Benchmark on NVIDIA® Jetson™ & Xavier™ NX

Jetson Xavier NX

07 September 2021

Hardware: DSBOX-NX2 Industrial Box PC

OS: Jetpack 4.5.0

In this blog post, we will benchmark deepstream Yolov5 example on NVIDIA® Jetson™  Xavier™ NX for fp16 model engine. Before we get started, make sure you set up Yolov5 on your module as explained in this blog post.

How to Download and Build Yolov5

First, you need to give permission to deepstream to be able to run the commands without sudo.

sudo chown -R nvidia /opt/nvidia/deepstream/ 

Then, create a directory called yolo inside deepstream/sources and go to the directory.

mkdir /opt/nvidia/deepstream/deepstream-5.1/sources/yolo 
cd /opt/nvidia/deepstream/deepstream-5.1/sources/yolo

You need to download Yolov5 and move it to created folder. Copy and paste the following link to your browser to download the Yolov5 folder and extract it.

Compile by using the following command.

CUDA_VER=10.2 make -C nvdsinfer_custom_impl_Yolo 

We will use two deepstream_app_config text to benchmark for different batch-sizes. You can change input stream, title etc. at the config files as well. 

Copy the model engine files into yolo directory that created previously. Change model-engine-file parameter in config_infer_primary.txt file for each model. 

How to Test and Benchmark Yolov5

We used fp16 model in this blog post. Run the deepstream-app after editing config files as you prefer. 

deepstream-app -c config_file 

FPS results when batch-size is 1 and the app receives the stream as one source.

FPS results, when batch-size is 2 and the app receives the stream as two sources.

Benchmark results are given at the table below. 

Thank you for reading our blog post.