Spatial detection for the Yolo NN. It is similar to a combination of the YoloDetectionNetwork
and SpatialLocationCalculator
.
py
pipeline = dai.Pipeline() yoloSpatial = pipeline.create(dai.node.YoloSpatialDetectionNetwork)
c++
dai::Pipeline pipeline; auto yoloSpatial = pipeline.create<dai::node::YoloSpatialDetectionNetwork>();
┌───────────────────┐
input │ │ passthrough ──────────────►│-------------------├─────────────────► │ Yolo │ out │ Spatial ├─────────────────► │ Detection │boundingBoxMapping │ Network ├─────────────────► inputDepth │ │ passthroughDepth ──────────────►│-------------------├─────────────────► └───────────────────┘
Message types
input
-ImgFrame
inputDepth
-ImgFrame
passthrough
-ImgFrame
out
-SpatialImgDetections
boundingBoxMapping
-SpatialLocationCalculatorConfig
passthroughDepth
-ImgFrame
py
pipeline = dai.Pipeline() yoloSpatial = pipeline.create(dai.node.YoloSpatialDetectionNetwork) yoloSpatial.setBlobPath(nnBlobPath)
# Spatial detection specific parameters yoloSpatial.setConfidenceThreshold(0.5) yoloSpatial.input.setBlocking(False) yoloSpatial.setBoundingBoxScaleFactor(0.5) yoloSpatial.setDepthLowerThreshold(100) # Min 10 centimeters yoloSpatial.setDepthUpperThreshold(5000) # Max 5 meters
# Yolo specific parameters yoloSpatial.setNumClasses(80) yoloSpatial.setCoordinateSize(4) yoloSpatial.setAnchors([10,14, 23,27, 37,58, 81,82, 135,169, 344,319]) yoloSpatial.setAnchorMasks({ "side26": [1,2,3], "side13": [3,4,5] }) yoloSpatial.setIouThreshold(0.5)
c++
dai::Pipeline pipeline; auto yoloSpatial = pipeline.create<dai::node::YoloSpatialDetectionNetwork>(); yoloSpatial->setBlobPath(nnBlobPath);
// Spatial detection specific parameters yoloSpatial->setConfidenceThreshold(0.5f); yoloSpatial->input.setBlocking(false); yoloSpatial->setBoundingBoxScaleFactor(0.5); yoloSpatial->setDepthLowerThreshold(100); // Min 10 centimeters yoloSpatial->setDepthUpperThreshold(5000); // Max 5 meters
// yolo specific parameters yoloSpatial->setNumClasses(80); yoloSpatial->setCoordinateSize(4); yoloSpatial->setAnchors({10, 14, 23, 27, 37, 58, 81, 82, 135, 169, 344, 319}); yoloSpatial->setAnchorMasks({{"side13", {3, 4, 5}}, {"side26", {1, 2, 3}}}); yoloSpatial->setIouThreshold(0.5f);
RGB & TinyYolo with spatial data
Python
depthai.node.YoloSpatialDetectionNetwork
C++
dai::node::YoloSpatialDetectionNetwork