vital This is this one: https://github.com/OAKChina/depthai-examples/blob/master/social-distancing/README.md
Basically, I "just" added routines for sending the mean of all distances over osc over udp.
Removing this specific custom part gives same results.
I think this is related to the fact this code is not for OAK D Pro W.
The part of the code I was looking at, in depthai_utils.py is in the class DeptAI 🇦
def create_pipeline(self, model_name):
log.info("Creating DepthAI pipeline...")
pipeline = dai.Pipeline()
#pipeline.setOpenVINOVersion(dai.OpenVINO.Version.VERSION_2021_2)
# Define sources and outputs
camRgb = pipeline.createColorCamera()
spatialDetectionNetwork = pipeline.createMobileNetSpatialDetectionNetwork()
monoLeft = pipeline.createMonoCamera()
monoRight = pipeline.createMonoCamera()
stereo = pipeline.createStereoDepth()
xoutRgb = pipeline.createXLinkOut()
camRgb.preview.link(xoutRgb.input)
xoutNN = pipeline.createXLinkOut()
xoutRgb.setStreamName("rgb")
xoutNN.setStreamName("detections")
# Properties
camRgb.setPreviewSize(544, 320)
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
camRgb.setInterleaved(False)
camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoLeft.setBoardSocket(dai.CameraBoardSocket.LEFT)
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoRight.setBoardSocket(dai.CameraBoardSocket.RIGHT)
# Setting node configs
stereo.setConfidenceThreshold(255)
spatialDetectionNetwork.setBlobPath(blobconverter.from_zoo(name=model_name, shaves=6))
spatialDetectionNetwork.setConfidenceThreshold(0.5)
spatialDetectionNetwork.input.setBlocking(False)
spatialDetectionNetwork.setBoundingBoxScaleFactor(0.5)
spatialDetectionNetwork.setDepthLowerThreshold(100)
spatialDetectionNetwork.setDepthUpperThreshold(5000)
# Linking
monoLeft.out.link(stereo.left)
monoRight.out.link(stereo.right)
camRgb.preview.link(spatialDetectionNetwork.input)
spatialDetectionNetwork.out.link(xoutNN.input)
stereo.depth.link(spatialDetectionNetwork.inputDepth)
log.info("Pipeline created.")
return pipeline
I guess I have something to do there. But maybe not.
The code was perfectly working with a OAK-D cam (no warning or error), but it gives what I described with OAK-D Pro W
Warning advising : "Align depth map to socket 'RGB' using 'setDepthAlign'."
But I don't know how to do that.