YoloDetectionNetwork
Yolo detection network extends NeuralNetwork node by also adding YOLO NN result decoding, which happens on the OAK device. This means thatOut of this node is not a NNData (a byte array) but a ImgDetections that can easily be used in your code.How to place it
Python
C++
Python
Python
1pipeline = dai.Pipeline()
2yoloDet = pipeline.create(dai.node.YoloDetectionNetwork)Inputs and Outputs
Usage
Python
C++
Python
Python
1pipeline = dai.Pipeline()
2yoloDet = pipeline.create(dai.node.YoloDetectionNetwork)
3yoloDet.setBlobPath(nnBlobPath)
4
5# Yolo specific parameters
6yoloDet.setConfidenceThreshold(0.5)
7yoloDet.setNumClasses(80)
8yoloDet.setCoordinateSize(4)
9yoloDet.setAnchors([10,14, 23,27, 37,58, 81,82, 135,169, 344,319])
10yoloDet.setAnchorMasks({"side26": [1, 2, 3], "side13": [3, 4, 5]})
11yoloDet.setIouThreshold(0.5)Examples of functionality
Reference
class
depthai.node.YoloDetectionNetwork(depthai.node.DetectionNetwork)
method
method
getAnchors(self) -> list[float]: list[float]Get anchors
method
getCoordinateSize(self) -> int: intGet coordianate size
method
getIouThreshold(self) -> float: floatGet Iou threshold
method
getNumClasses(self) -> int: intGet num classes
method
setAnchorMasks(self, anchorMasks: dict
[
str
,
list
[
int
]
])Set anchor masks
method
setAnchors(self, anchors: list
[
float
])Set anchors
method
setCoordinateSize(self, coordinates: int)Set coordianate size
method
setIouThreshold(self, thresh: float)Set Iou threshold
method
setNumClasses(self, numClasses: int)Set num classes
Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.