diff --git a/picamera2/devices/imx500/imx500.py b/picamera2/devices/imx500/imx500.py index ef9518c7..ee944e78 100644 --- a/picamera2/devices/imx500/imx500.py +++ b/picamera2/devices/imx500/imx500.py @@ -581,14 +581,11 @@ def __get_input_tensor_info(self, tensor_info) -> tuple[str, int, int, int]: @staticmethod def get_kpi_info(metadata: dict) -> Optional[tuple[float, float]]: - """Return the KPI parameters in the form (dnn_runtime, dsp_runtime).""" + """Return the KPI parameters in the form (dnn_runtime, dsp_runtime) in milliseconds.""" kpi_info = metadata.get('CnnKpiInfo') if kpi_info is None: return None - if type(kpi_info) not in [bytes, bytearray]: - kpi_info = bytes(kpi_info) - - dnn_runtime, dsp_runtime = struct.unpack('II', kpi_info) + dnn_runtime, dsp_runtime = kpi_info[0], kpi_info[1] return dnn_runtime / 1000, dsp_runtime / 1000 def __set_network_firmware(self, network_filename: str):