ON THIS PAGE

  • Nodes
  • Inputs and outputs
  • Node input
  • Node output

Nodes

Nodes are the building blocks when populating the Pipeline. Each node provides a specific functionality on the DepthAI, a set of configurable properties and inputs/outputs. After you create a node on a pipeline, you can also configure it as desired and link it to other nodes.On the table of contents (left side of the page) all nodes are listed under the Node entry. You can click on them to find out more.

Inputs and outputs

Each node can have zero, one or multiple inputs and outputs. For example, SystemLogger node has no inputs and 1 output and EdgeDetector has 2 inputs and 1 output (as shown below). Script node can have any number of inputs/ouputs.
None
1inputImage     ┌──────────────────┐
2──────────────►│                  │
3               │                  │ outputImage
4               │   EdgeDetector   ├───────────►
5inputConfig    │                  │
6──────────────►│                  │
7               └──────────────────┘
8    EdgeDetector node has 2 inputs and 1 output
Each node's output has its pool; block in RAM where it stores messages. Each node's input has its queue for message pointers (doesn't store the message itself, just a pointer to it).

Node input

Node input queue is a queue for Messages. It can be linked with other node's output (that's how you link up nodes). Node inputs are configurable - with input.setBlocking(bool) and input.setQueueSize(num), eg. edgeDetector.inputImage.setQueueSize(10). If the input queue fills up, behavior of the input depends on blocking attribute.Let's say we have linked ColorCamera preview output with NeuralNetwork input input.
None
1┌─────────────┐                    ┌───────────────┐
2│             │                    │               │
3│             │ preview      input │               │
4│ ColorCamera ├───────────────────►│ NeuralNetwork │
5│             │     [ImgFrame]     │               │
6│             │                    │               │
7└─────────────┘                    └───────────────┘
If input is set to blocking mode, and input queue fills up, no new messages from ColorCamera will be able to enter the input queue. This means ColorCamera will block and wait with sending its messages until it can push the message to the queue of NeuralNetwork input. If ColorCamera preview is connected to multiple inputs, the same behavior implies, with the messages being pushed sequentially to each input.If blocking is disabled, new messages will push out old messages. This eliminates the risk of pipeline freezing, but can result in dropped messages (eg. ImgFrame).

Node output

Node outputs Messages. Some nodes have a configurable output message pool. Output message pool is a reserved memory region (to reduce memory fragmentation) that holds output messages. After the node creates an output message (for example ImgFrame), it will send it to other nodes as specified when linking the inputs/outputs of the node. Currently, some nodes (VideoEncoder, NeuralNetwork, ImageManip, XLinkIn) can have the pool size configured. The size of the pool specifies how many messages can be created and sent out while other messages are already somewhere in the pipeline.
class

depthai.Node

class
Connection
Connection between an Input and Output
class
class
Id
Node identificator. Unique for every node on a single Pipeline
class
class
class
class
variable
method
method
method
method
getName(self) -> str: str
Retrieves nodes name
method
method
method
property
id
Id of node
class

depthai.Node.Connection

class

depthai.Node.DatatypeHierarchy

class

depthai.Node.Input

class
Type
Members:
variable
variable
variable
variable
variable
method
getBlocking(self) -> bool: bool
Get input queue behavior

Returns:
    True blocking, false overwriting
method
method
getQueueSize(self) -> int: int
Get input queue size.

Returns:
    Maximum input queue size
method
getReusePreviousMessage(self) -> bool: bool
Equivalent to getWaitForMessage but with inverted logic.
method
getWaitForMessage(self) -> bool: bool
Get behavior whether to wait for this input when a Node processes certain data
or not

Returns:
    Whether to wait for message to arrive to this input or not
method
setBlocking(self, blocking: bool)
Overrides default input queue behavior.

Parameter ``blocking``:
    True blocking, false overwriting
method
setQueueSize(self, size: int)
Overrides default input queue size. If queue size fills up, behavior depends on
`blocking` attribute

Parameter ``size``:
    Maximum input queue size
method
setReusePreviousMessage(self, reusePreviousMessage: bool)
Equivalent to setWaitForMessage but with inverted logic.
method
setWaitForMessage(self, waitForMessage: bool)
Overrides default wait for message behavior. Applicable for nodes with multiple
inputs. Specifies behavior whether to wait for this input when a Node processes
certain data or not.

Parameter ``waitForMessage``:
    Whether to wait for message to arrive to this input or not
class

depthai.Node.Output

class
Type
Members:
variable
variable
variable
variable
method
canConnect(self, input: Node.Input) -> bool: bool
Check if connection is possible

Parameter ``in``:
    Input to connect to

Returns:
    True if connection is possible, false otherwise
method
getConnections(self) -> list[Node.Connection]: list[Node.Connection]
Retrieve all connections from this output

Returns:
    Vector of connections
method
method
isSamePipeline(self, input: Node.Input) -> bool: bool
Check if this output and given input are on the same pipeline.

See also:
    canConnect for checking if connection is possible

Returns:
    True if output and input are on the same pipeline
method
method