ON THIS PAGE

  • NNData
  • Creating NNData
  • Reference

NNData

This message carries tensors and its data. NeuralNetwork node outputs NNData.

Creating NNData

You can also create this message on the host (example here) or Script node (Script NNData example), populate the tensor with the data, and send the message to the input of the NeuralNetwork node.

Reference

class

depthai.NNData(depthai.Buffer)

method
__init__(self)
Construct NNData message.
method
getAllLayerNames(self) -> list[str]: list[str]
Returns:     Names of all layers added
method
getAllLayers(self) -> list[TensorInfo]: list[TensorInfo]
Returns:     All layers and their information
method
getFirstLayerFp16(self) -> list[float]: list[float]
Convenience function to retrieve float values from first layers FP16 tensor  Returns:     Float data
method
getFirstLayerInt32(self) -> list[int]: list[int]
Convenience function to retrieve INT32 values from first layers tensor  Returns:     INT32 data
method
getFirstLayerUInt8(self) -> list[int]: list[int]
Convenience function to retrieve U8 data from first layer  Returns:     U8 binary data
method
getLayer(self, name: str, tensor: TensorInfo) -> bool: bool
Retrieve layers tensor information  Parameter ``name``:     Name of the layer  Parameter ``tensor``:     Outputs tensor information of that layer  Returns:     True if layer exists, false otherwise
method
getLayerDatatype(self, name: str, datatype: TensorInfo.DataType) -> bool: bool
Retrieve datatype of a layers tensor  Parameter ``name``:     Name of the layer  Parameter ``datatype``:     Datatype of layers tensor  Returns:     True if layer exists, false otherwise
method
getLayerFp16(self, name: str) -> list[float]: list[float]
Convenience function to retrieve float values from layers FP16 tensor  Parameter ``name``:     Name of the layer  Returns:     Float data
method
getLayerInt32(self, name: str) -> list[int]: list[int]
Convenience function to retrieve INT32 values from layers tensor  Parameter ``name``:     Name of the layer  Returns:     INT32 data
method
getLayerUInt8(self, name: str) -> list[int]: list[int]
Convenience function to retrieve U8 data from layer  Parameter ``name``:     Name of the layer  Returns:     U8 binary data
method
getSequenceNum(self) -> int: int
Retrieves sequence number
method
getTimestamp(self) -> datetime.timedelta: datetime.timedelta
Retrieves timestamp related to dai::Clock::now()
method
getTimestampDevice(self) -> datetime.timedelta: datetime.timedelta
Retrieves timestamp directly captured from device's monotonic clock, not synchronized to host time. Used mostly for debugging
method
hasLayer(self, name: str) -> bool: bool
Checks if given layer exists  Parameter ``name``:     Name of the layer  Returns:     True if layer exists, false otherwise
method
method
method
setTimestamp(self, arg0: datetime.timedelta) -> NNData: NNData
Sets image timestamp related to dai::Clock::now()
method
setTimestampDevice(self, arg0: datetime.timedelta) -> NNData: NNData
Sets image timestamp related to dai::Clock::now()

Need assistance?

Head over to Discussion Forum for technical support or any other questions you might have.