Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose parsers when building a pipeline through ParsingNeuralNetwork #149

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions depthai_nodes/parsing_neural_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading