Spherical Video PTZ/Performance/Jetson AGX Xavier: Difference between revisions

From RidgeRun Developer Wiki
Line 23: Line 23:
|+ Spherical Video PTZ performance
|+ Spherical Video PTZ performance
|-
|-
! n !! Images type !! PTZ used !! Input size (px) !! Output size (px) !! RAM (MiB) !! GPU !! CPU !! Avg processing time (ms)
! n !! Images type !! PTZ used !! Input size (px) !! Output size (px) !! RAM (MiB) !! GPU !! Avg CPU (%) !! Avg processing time (ms)
|-
|-
| 1 || Image || No || 2000x1000 || 500x500 || (phys) 120.00 || (Usage) 1.18 % (VRAM) 6.00 MiB || (all) 10.47 % (core) 83.77 % || 6.845
| 1 || Image || No || 2000x1000 || 500x500 || (phys) 120.00 || (Usage) 1.18 % (VRAM) 6.00 MiB || 10.47 % || 6.845
|-
|-
| 2 || Image || No || 4000x2000 || 500x500 || (phys) 171.00 || (Usage) 4.40 % (VRAM) 6.00 MiB || (all) 11.11 % (core) 88.90 % || 14.472
| 2 || Image || No || 4000x2000 || 500x500 || (phys) 171.00 || (Usage) 4.40 % (VRAM) 6.00 MiB || 11.11 % || 14.472
|-
|-
| 3 || Image || No || 4000x2000 || 1000x1000 || (phys) 174.00 || (Usage) 5.10 % (VRAM) 7.00 MiB || (all) 10.92 % (core) 87.38 % || 14.738
| 3 || Image || No || 4000x2000 || 1000x1000 || (phys) 174.00 || (Usage) 5.10 % (VRAM) 7.00 MiB || 10.92 % || 14.738
|-
|-
| 4 || Image || Yes || 2000x1000 || 500x500 || (phys) 124.00 || (Usage) 5.14 % (VRAM) 6.00 MiB || (all) 5.64 % (core) 45.15 % || 12.027
| 4 || Image || Yes || 2000x1000 || 500x500 || (phys) 124.00 || (Usage) 5.14 % (VRAM) 6.00 MiB || 5.64 % || 12.027
|-
|-
| 5 || Image || Yes || 4000x2000 || 500x500 || (phys) 179.00 || (Usage) 6.30 % (VRAM) 6.00 MiB || (all) 7.24 % (core) 57.91 % || 22.648
| 5 || Image || Yes || 4000x2000 || 500x500 || (phys) 179.00 || (Usage) 6.30 % (VRAM) 6.00 MiB || 7.24 % || 22.648
|-
|-
| 6 || Image || Yes || 4000x2000 || 1000x1000 || (phys) 183.00 || (Usage) 7.47 % (VRAM) 7.00 MiB || (all) 5.68 % (core) 45.47 % || 30.252
| 6 || Image || Yes || 4000x2000 || 1000x1000 || (phys) 183.00 || (Usage) 7.47 % (VRAM) 7.00 MiB || 5.68 % || 30.252
|-
|-
| 7 || CudaImage || No || 2000x1000 || 500x500 ||  (phys) 121.00 || (Usage) 0.02 % (VRAM) 7.00 MiB || (all) 1.73 % (core) 13.86 % || 0.336
| 7 || CudaImage || No || 2000x1000 || 500x500 ||  (phys) 121.00 || (Usage) 0.02 % (VRAM) 7.00 MiB || 1.73 % || 0.336
|-
|-
| 8 || CudaImage || No || 4000x2000 || 500x500 || (phys) 170.00 || (Usage) 0.05 % (VRAM) 10.00 MiB || (all) 1.54 % (core) 12.35 % || 0.352
| 8 || CudaImage || No || 4000x2000 || 500x500 || (phys) 170.00 || (Usage) 0.05 % (VRAM) 10.00 MiB || 1.54 % || 0.352
|-
|-
| 9 || CudaImage || No || 4000x2000 || 1000x1000 || (phys) 177.00 || (Usage) 0.10 % (VRAM) 11.00 MiB || (all) 1.55 % (core) 12.37 % || 0.380
| 9 || CudaImage || No || 4000x2000 || 1000x1000 || (phys) 177.00 || (Usage) 0.10 % (VRAM) 11.00 MiB || 1.55 % || 0.380
|-
|-
| 10 || CudaImage || Yes || 2000x1000 || 500x500 || (phys) 119.00 || (Usage) 0.40 % (VRAM) 7.00 MiB || (all) 3.64 % (core) 29.15 % || 5.389
| 10 || CudaImage || Yes || 2000x1000 || 500x500 || (phys) 119.00 || (Usage) 0.40 % (VRAM) 7.00 MiB || 3.64 % || 5.389
|-
|-
| 11 || CudaImage || Yes || 4000x2000 || 500x500 || (phys) 170.00 || (Usage) 0.62 % (VRAM) 10.00 MiB || (all) 3.39 % (core) 27.09 % || 6.812
| 11 || CudaImage || Yes || 4000x2000 || 500x500 || (phys) 170.00 || (Usage) 0.62 % (VRAM) 10.00 MiB || 3.39 % || 6.812
|-
|-
| 12 || CudaImage || Yes || 4000x2000 || 1000x1000 || (phys) 172.00 || (Usage) 5.70 % (VRAM) 11.00 MiB || (all) 2.09 % (core) 16.71 % || 19.471
| 12 || CudaImage || Yes || 4000x2000 || 1000x1000 || (phys) 172.00 || (Usage) 5.70 % (VRAM) 11.00 MiB || 2.09 % || 19.471
|}
|}
Please consider the following points:
* Image Type: This refers to whether the input and output images use the '''lp/allocators/cudaimage.hpp''' library (images allocated in '''GPU memory''') or the '''lp/image.hpp''' library (images allocated in '''CPU memory'''). In the results, it is evident that processing time is higher when using an Image compared to a CudaImage. This difference arises because although the engine wrapper accepts both types of images, when using an Image, the engine internally creates a copy of the CPU memory to perform operations on the GPU. This copying process consumes considerable time compared to using an image already allocated in GPU memory.
* PTZ Usage: This indicates a change in the pan, tilt, or zoom property before processing the input image. Consequently, the engine wrapper executes an additional step to calculate the output image, leading to an increase in processing time.


===Gstreamer element: rrpanoramaptz===
===Gstreamer element: rrpanoramaptz===

Revision as of 20:38, 3 April 2024


  Index Next: Contact_Us





Benchmark environment

The measurements are taken considering the following criteria:

  • Average behaviour: measurements considering typical image processing pipelines.

Instruments:

  • GPU: Jtop
  • CPU: RidgeRun Profiler
  • RAM: RidgeRun Profiler
  • Framerate: GstShark

Engine wrapper

As previously mentioned, the Spherical Video PTZ features an engine wrapper, designed for application development. This section aims to conduct performance measurements using the average value obtained after processing the input image through the 'Process' method of the Spherical Video PTZ engine wrapper. The values presented in the table below are the averages obtained after using the Process method 1000 times. This testing was conducted using the 8 cores of the MODE_30W_ALL mode on a Jetson AGX Xavier with JetPack 5.1.2.


Spherical Video PTZ performance
n Images type PTZ used Input size (px) Output size (px) RAM (MiB) GPU Avg CPU (%) Avg processing time (ms)
1 Image No 2000x1000 500x500 (phys) 120.00 (Usage) 1.18 % (VRAM) 6.00 MiB 10.47 % 6.845
2 Image No 4000x2000 500x500 (phys) 171.00 (Usage) 4.40 % (VRAM) 6.00 MiB 11.11 % 14.472
3 Image No 4000x2000 1000x1000 (phys) 174.00 (Usage) 5.10 % (VRAM) 7.00 MiB 10.92 % 14.738
4 Image Yes 2000x1000 500x500 (phys) 124.00 (Usage) 5.14 % (VRAM) 6.00 MiB 5.64 % 12.027
5 Image Yes 4000x2000 500x500 (phys) 179.00 (Usage) 6.30 % (VRAM) 6.00 MiB 7.24 % 22.648
6 Image Yes 4000x2000 1000x1000 (phys) 183.00 (Usage) 7.47 % (VRAM) 7.00 MiB 5.68 % 30.252
7 CudaImage No 2000x1000 500x500 (phys) 121.00 (Usage) 0.02 % (VRAM) 7.00 MiB 1.73 % 0.336
8 CudaImage No 4000x2000 500x500 (phys) 170.00 (Usage) 0.05 % (VRAM) 10.00 MiB 1.54 % 0.352
9 CudaImage No 4000x2000 1000x1000 (phys) 177.00 (Usage) 0.10 % (VRAM) 11.00 MiB 1.55 % 0.380
10 CudaImage Yes 2000x1000 500x500 (phys) 119.00 (Usage) 0.40 % (VRAM) 7.00 MiB 3.64 % 5.389
11 CudaImage Yes 4000x2000 500x500 (phys) 170.00 (Usage) 0.62 % (VRAM) 10.00 MiB 3.39 % 6.812
12 CudaImage Yes 4000x2000 1000x1000 (phys) 172.00 (Usage) 5.70 % (VRAM) 11.00 MiB 2.09 % 19.471


Please consider the following points:

  • Image Type: This refers to whether the input and output images use the lp/allocators/cudaimage.hpp library (images allocated in GPU memory) or the lp/image.hpp library (images allocated in CPU memory). In the results, it is evident that processing time is higher when using an Image compared to a CudaImage. This difference arises because although the engine wrapper accepts both types of images, when using an Image, the engine internally creates a copy of the CPU memory to perform operations on the GPU. This copying process consumes considerable time compared to using an image already allocated in GPU memory.
  • PTZ Usage: This indicates a change in the pan, tilt, or zoom property before processing the input image. Consequently, the engine wrapper executes an additional step to calculate the output image, leading to an increase in processing time.

Gstreamer element: rrpanoramaptz

Processing time:

Processing time without ptz transformations(2000x1000):

GST_DEBUG="GST_TRACER:7" GST_TRACERS="proctime" gst-launch-1.0 videotestsrc is-live=true num-buffers=200 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! rrpanoramaptz ! "video/x-raw,width=2000,height=1000" ! fakesink
Element performance

The graph depicts individual processing times for each element. For a more accurate representation, the average processing times in milliseconds (ms) are as follows:

  • queue0: 0.598 ms
  • rrpanoramaptz0: 3.146 ms
  • capsfilter0: 0.116 ms

Framerate:

Framerate: 30 fps (2000x1000):

GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc is-live=true num-buffers=200 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! rrpanoramaptz ! "video/x-raw,width=2000,height=1000" ! fakesink
Element performance

Framerate: 30 fps (1000x500 - 2000x1000):

GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc is-live=true num-buffers=300 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! "video/x-raw,width=1000,height=500,framerate=30/1" ! rrpanoramaptz ! "video/x-raw,width=2000,height=1000,framerate=30/1" ! fakesink
Element performance

Framerate: 30 fps (2000x1000 - 1000x500):

GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc is-live=true num-buffers=300 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! "video/x-raw,width=1000,height=500,framerate=30/1" ! rrpanoramaptz ! "video/x-raw,width=2000,height=1000,framerate=30/1" ! fakesink
Element performance

Framerate: 60 fps (2000x1000):

GST_DEBUG="GST_TRACER:7" GST_TRACERS="framerate" gst-launch-1.0 videotestsrc is-live=true num-buffers=300 ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 ! rrpanoramaptz ! "video/x-raw,width=2000,height=1000,framerate=60/1" ! fakesink
Element performance




  Index Next: Contact_Us