DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.

ON THIS PAGE

  • How to place it
  • Inputs and Outputs
  • Usage
  • Examples of functionality
  • Spatial coordinate system
  • Reference

MobileNetSpatialDetectionNetwork

Spatial detection for the MobileNet NN. It is similar to a combination of the MobileNetDetectionNetwork and SpatialLocationCalculator.

How to place it

Python

Python
1pipeline = dai.Pipeline()
2mobilenetSpatial = pipeline.create(dai.node.MobileNetSpatialDetectionNetwork)

C++

C++
1dai::Pipeline pipeline;
2auto mobilenetSpatial = pipeline.create<dai::node::MobileNetSpatialDetectionNetwork>();

Inputs and Outputs

Usage

Python

Python
1pipeline = dai.Pipeline()
2mobilenetSpatial = pipeline.create(dai.node.MobileNetSpatialDetectionNetwork)
3
4mobilenetSpatial.setBlobPath(nnBlobPath)
5# Will ingore all detections whose confidence is below 50%
6mobilenetSpatial.setConfidenceThreshold(0.5)
7mobilenetSpatial.input.setBlocking(False)
8# How big the ROI will be (smaller value can provide a more stable reading)
9mobilenetSpatial.setBoundingBoxScaleFactor(0.5)
10# Min/Max threshold. Values out of range will be set to 0 (invalid)
11mobilenetSpatial.setDepthLowerThreshold(100)
12mobilenetSpatial.setDepthUpperThreshold(5000)
13
14# Link depth from the StereoDepth node
15stereo.depth.link(mobilenetSpatial.inputDepth)

C++

C++
1dai::Pipeline pipeline;
2auto mobilenetSpatial = pipeline.create<dai::node::MobileNetSpatialDetectionNetwork>();
3
4mobilenetSpatial->setBlobPath(nnBlobPath);
5// Will ingore all detections whose confidence is below 50%
6mobilenetSpatial->setConfidenceThreshold(0.5f);
7mobilenetSpatial->input.setBlocking(false);
8// How big the ROI will be (smaller value can provide a more stable reading)
9mobilenetSpatial->setBoundingBoxScaleFactor(0.5f);
10// Min/Max threshold. Values out of range will be set to 0 (invalid)
11mobilenetSpatial->setDepthLowerThreshold(100);
12mobilenetSpatial->setDepthUpperThreshold(5000);
13
14// Link depth from the StereoDepth node
15stereo->depth.link(mobilenetSpatial->inputDepth);

Examples of functionality

Spatial coordinate system

OAK camera uses left-handed (Cartesian) coordinate system for all spatial coordinates.
Spatial coordinate system

Reference

class

depthai.node.MobileNetSpatialDetectionNetwork(depthai.node.SpatialDetectionNetwork)

Need assistance?

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