ON THIS PAGE

  • DetectionNetwork
  • How to place it
  • Inputs and Outputs
  • Usage
  • Examples of functionality
  • Reference

DetectionNetwork

DetectionNetwork node extends the NeuralNetwork by also performing on-camera parsing (decoding) step, which parses the NN output (byte array) into bounding boxes, labels, and confidence values, which are formatted into ImgDetections message.Detection Network currently supports YOLO and SSD NN output formats, and replaces YoloDetectionNetwork and MobileNetDetectionNetwork from DepthAI API v2.

How to place it

Python
C++

Python

Python
1pipeline = dai.Pipeline()
2detection = pipeline.create(dai.node.DetectionNetwork)

Inputs and Outputs

outNetwork outputs raw/unparsed NN output (byte array) from the NN, which could be used for custom parsing on the host.

Usage

Python
C++

Python

Python
1pipeline = dai.Pipeline()
2camera = pipeline.create(dai.node.Camera).build()
3detection = pipeline.create(dai.node.DetectionNetwork).build(camera, dai.NNModelDescription("yolov6-nano"))
4detection.setConfidenceThreshold(0.5)
5detection.input.setBlocking(False)

Examples of functionality

RGB + Detection Network

Reference

class

depthai.node.DetectionNetwork(depthai.node.NeuralNetwork)

method
getConfidenceThreshold(self) -> float: float
Retrieves threshold at which to filter the rest of the detections.  Returns:     Detection confidence
method
setConfidenceThreshold(self, thresh: float)
Specifies confidence threshold at which to filter the rest of the detections.  Parameter ``thresh``:     Detection confidence must be greater than specified threshold to be added to     the list
property
input
Input message with data to be inferred upon Default queue is blocking with size 5
property
out
Outputs ImgDetections message that carries parsed detection results. Overrides NeuralNetwork 'out' with ImgDetections output message type.
property
outNetwork
Outputs unparsed inference results.
property
passthrough
Passthrough message on which the inference was performed.  Suitable for when input queue is set to non-blocking behavior.

Need assistance?

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