Skip to content

Commit a1791a0

Browse files
committed
Added 3A FPS limiting to debugging docs (debugging CPU usage)
1 parent 9f11020 commit a1791a0

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docs/source/tutorials/debugging.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,43 @@ specifically SHAVE core and CMX memory usage:
121121
122122
In total, this pipeline consumes 15 SHAVE cores and 16 CMX slices. The pipeline is running an object detection model compiled for 6 SHAVE cores.
123123

124+
CPU usage
125+
=========
126+
127+
When setting the :ref:`DepthAI debugging level` to debug (or lower), depthai will also print our CPU usage for LeonOS and LeonRT. CPU usage
128+
at 100% (or close to it) can cause many undesirable effects, such as higher frame latency, lower FPS, and in some cases even firmware crash.
129+
130+
Compared to OAK USB cameras, OAK PoE cameras will have increased CPU consumption, as the networking stack is running on the LeonOS core. Besides
131+
reducing pipeline (doing less processing), a good alternative is to reduce 3A FPS (ISP). This means that 3A algorithms (auto exposure, auto white balance
132+
and auto focus) won't be run every frame, but every N frames. When updating DepthAI SDK's `camera_preview.py <https://github.com/luxonis/depthai/blob/main/depthai_sdk/examples/CameraComponent/camera_preview.py>`__
133+
example (code change below), the LeonOS CPU usage decreased from 100% to ~46%:
134+
135+
.. code-block:: bash
136+
137+
# Without 3A FPS limit on OAK PoE camera:
138+
Cpu Usage - LeonOS 99.99%, LeonRT: 6.91%
139+
140+
# Limiting 3A to 15 FPS on OAK PoE camera:
141+
Cpu Usage - LeonOS 46.24%, LeonRT: 3.90%
142+
143+
Not having 100% CPU usage also drastically decreased frame latency, in the example for the script below it went from ~710 ms to ~110ms:
144+
145+
.. image::
146+
147+
.. code-block:: diff
148+
149+
from depthai_sdk import OakCamera
150+
151+
with OakCamera() as oak:
152+
color = oak.create_camera('color')
153+
left = oak.create_camera('left')
154+
right = oak.create_camera('right')
155+
156+
+ # Limiting 3A to 15 FPS
157+
+ for node in [color.node, left.node, right.node]:
158+
+ node.setIsp3aFps(15)
159+
160+
oak.visualize([color, left, right], fps=True, scale=2/3)
161+
oak.start(blocking=True)
162+
124163
.. include:: /includes/footer-short.rst

0 commit comments

Comments
 (0)