diff --git a/depthai_nodes/parsing_neural_network.py b/depthai_nodes/parsing_neural_network.py index db757b7..7126ed3 100644 --- a/depthai_nodes/parsing_neural_network.py +++ b/depthai_nodes/parsing_neural_network.py @@ -127,6 +127,17 @@ def setBackend(self, setBackend: str) -> None: """Sets the backend of the NeuralNetwork node.""" self._nn.setBackend(setBackend) + def getParser(self, index: int = 0) -> BaseParser: + """Returns the parser node for the given model head index. + + If index is not provided, the first parser node is returned by default. + """ + if index not in self._parsers: + raise KeyError( + f"Parser with ID {index} not found. Available parser IDs: {list(self._parsers.keys())}" + ) + return self._parsers[index] + def setBackendProperties(self, setBackendProperties: Dict[str, str]) -> None: """Sets the backend properties of the NeuralNetwork node.""" self._nn.setBackendProperties(setBackendProperties)