ON THIS PAGE

  • MobileNetSpatialDetectionNetwork
  • 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
C++
Python
1pipeline = dai.Pipeline()
2mobilenetSpatial = pipeline.create(dai.node.MobileNetSpatialDetectionNetwork)

Inputs and Outputs

Command Line
1/
2                 ┌───────────────────┐
3  input          │                   │       passthrough
4  ──────────────►│-------------------├─────────────────►
5                 │     MobileNet     │               out
6                 │     Spatial       ├─────────────────►
7                 │     Detection     │boundingBoxMapping
8                 │     Network       ├─────────────────►
9  inputDepth     │                   │  passthroughDepth
10  ──────────────►│-------------------├─────────────────►
11                 └───────────────────┘
Message types

Usage

Python
C++
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)

Examples of functionality

Spatial coordinate system

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

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.