oakutils.benchmark package

Module contents

Submodule for benchmarking characteristics of OAK devices.

Functions

measure_latency

Measure the latency of communication with the device.

measure_throughput

Measure the throughput of the devices connection.

oakutils.benchmark.measure_latency(device_id: str | None = None, iterations: int = 100) tuple[float, float, list[float]]

Measure the latency of the DepthAI device.

Parameters:
  • device_id (str, optional) – The id of the device to use, by default None This can be a MXID, IP address, or USB port name. Examples: “14442C108144F1D000”, “

  • iterations (int, optional) – The number of iterations to run, by default 100

Returns:

The average latency, the standard deviation of latency, and the raw data.

Return type:

tuple[float, float, list[float]]

Notes

Modified from script at: https://github.com/luxonis/depthai-experiments/blob/master/random-scripts/oak_latency_test.py

oakutils.benchmark.measure_throughput(device_id: str | None = None, max_usb_speed: UsbSpeed | None = None, iterations: int = 50, discard: int = 10, size: int = 10000000) tuple[float, float]

Measure the throughput of the DepthAI device.

Parameters:
  • device_id (str, optional) – The id of the device to use, by default None This can be a MXID, IP address, or USB port name. Examples: “14442C108144F1D000”, “

  • max_usb_speed (dai.UsbSpeed, optional) – The maximum USB speed to use, by default None Options are available in dai.UsbSpeed

  • iterations (int, optional) – The number of iterations to run, by default 50

  • discard (int, optional) – The number of iterations to discard for warmup, by default 10

  • size (int, optional) – The size of the data to send, by default 10_000_000 or 20MB

Returns:

The downlink and uplink throughput in MB/s.

Return type:

tuple[float, float]

Notes

Modified from script at: https://github.com/luxonis/depthai-experiments/blob/master/random-scripts/oak_bandwidth_test.py