diff --git a/frigate/detectors/detection_runners.py b/frigate/detectors/detection_runners.py index 1890034cc..b262f667f 100644 --- a/frigate/detectors/detection_runners.py +++ b/frigate/detectors/detection_runners.py @@ -87,7 +87,10 @@ class CudaGraphRunner(BaseModelRunner): """Get the input width of the model.""" return self._session.get_inputs()[0].shape[3] - def run(self, input_name: str, tensor_input: np.ndarray): + def run(self, input: dict[str, Any]): + # Extract the single tensor input (assuming one input) + input_name = list(input.keys())[0] + tensor_input = input[input_name] tensor_input = np.ascontiguousarray(tensor_input) if not self._captured: diff --git a/frigate/detectors/plugins/onnx.py b/frigate/detectors/plugins/onnx.py index 108481884..955a58524 100644 --- a/frigate/detectors/plugins/onnx.py +++ b/frigate/detectors/plugins/onnx.py @@ -95,7 +95,7 @@ class ONNXDetector(DetectionApi): if self._cg_runner is not None: try: # Run using CUDA graphs if available - tensor_output = self._cg_runner.run(model_input_name, tensor_input) + tensor_output = self._cg_runner.run({model_input_name: tensor_input}) except Exception as e: logger.warning(f"CUDA Graphs failed, falling back to regular run: {e}") self._cg_runner = None