Hello. I use OAK-D to call the rgb camera and binocular camera at the same time, and an error always appears.
The following is my code:
`def create_pipeline(self):
print("Creating pipeline...")
self.pipeline = depthai.Pipeline()
if self.camera:
print("Creating Color Camera...")
cam = self.pipeline.createColorCamera()
cam.setPreviewSize(300,300)
cam.setResolution(depthai.ColorCameraProperties.SensorResolution.THE_1080_P)
cam.setInterleaved(False)
cam.setCamId(0)
cam_xout = self.pipeline.createXLinkOut()
cam_xout.setStreamName("cam_out")
cam.preview.link(cam_xout.input)
self.models("models/face-detection-retail-0004.blob","face")
def create_monoCamera(self):
print("start Creating MoneCamera...")
left = self.pipeline.createMonoCamera()
left.setResolution(depthai.MonoCameraProperties.SensorResolution.THE_400_P)
left.setCamId(1)
right = self.pipeline.createMonoCamera()
right.setResolution(depthai.MonoCameraProperties.SensorResolution.THE_400_P)
right.setCamId(2)
depth = self.pipeline.createStereoDepth()
depth.setConfidenceThreshold(200)
depth.setOutputDepth(True)
left.out.link(depth.left)
right.out.link(depth.right)
xout = self.pipeline.createXLinkOut()
xout.setStreamName("disparity")
depth.depth.link(xout.input)
print("Created",time.asctime(time.localtime(time.time())))
def models(self,model_path,name):
print(f"开始创建{model_path}神经网络")
model_in = self.pipeline.createXLinkIn()
model_in.setStreamName(f"{name}_in")
model_nn = self.pipeline.createNeuralNetwork()
model_nn.setBlobPath(str(Path(model_path).resolve().absolute()))
model_nn_xout = self.pipeline.createXLinkOut()
model_nn_xout.setStreamName(f"{name}_nn")
model_in.out.link(model_nn.input)
model_nn.out.link(model_nn_xout.input)
def start_pipeline(self):
self.device = depthai.Device(self.pipeline)
print("Starting pipeline...")
self.device.startPipeline()
if self.camera:
self.cam_out = self.device.getOutputQueue("cam_out", 1, True)
self.depth_out = self.device.getOutputQueue(name="disparity",maxSize=4)
self.face_in = self.device.getInputQueue("face_in",)
self.face_nn = self.device.getOutputQueue("face_nn",4)`
The DepthAI version I use: depthai==0.0.2.1+d436ec6b629c09b92c58d869e80aac52367a3aa9
When I change the version:
The first two models can run well, but after adding to the third model, an error is reported。
`def create_pipeline(self):
print("Creating pipeline...")
self.pipeline = depthai.Pipeline()
if self.camera:
print("Creating Color Camera...")
cam = self.pipeline.createColorCamera()
cam.setPreviewSize(300,300)
cam.setResolution(depthai.ColorCameraProperties.SensorResolution.THE_1080_P)
cam.setInterleaved(False)
cam_xout = self.pipeline.createXLinkOut()
cam_xout.setStreamName("cam_out")
cam.preview.link(cam_xout.input)
self.models("models/face-detection-retail-0004.blob","face")
self.models("models/landmarks-regression-retail-0009.blob","land")
self.models("models/face-reidentification-retail-0095.blob",'reid')
def create_monoCamera(self):
print("start Creating MoneCamera...")
left = self.pipeline.createMonoCamera()
left.setResolution(depthai.MonoCameraProperties.SensorResolution.THE_400_P)
left.setBoardSocket(depthai.CameraBoardSocket.LEFT)
right = self.pipeline.createMonoCamera()
right.setResolution(depthai.MonoCameraProperties.SensorResolution.THE_400_P)
right.setBoardSocket(depthai.CameraBoardSocket.RIGHT)
depth = self.pipeline.createStereoDepth()
depth.setConfidenceThreshold(200)
depth.setOutputDepth(True)
left.out.link(depth.left)
right.out.link(depth.right)
xout = self.pipeline.createXLinkOut()
xout.setStreamName("disparity")
depth.depth.link(xout.input)
print("Created",time.asctime(time.localtime(time.time())))
def models(self,model_path,name):
print(f"开始创建{model_path}神经网络")
model_in = self.pipeline.createXLinkIn()
model_in.setStreamName(f"{name}_in")
model_nn = self.pipeline.createNeuralNetwork()
model_nn.setBlobPath(str(Path(model_path).resolve().absolute()))
model_nn_xout = self.pipeline.createXLinkOut()
model_nn_xout.setStreamName(f"{name}_nn")
model_in.out.link(model_nn.input)
model_nn.out.link(model_nn_xout.input)
def start_pipeline(self):
self.device = depthai.Device(self.pipeline)
print("Starting pipeline...")
self.device.startPipeline()
if self.camera:
self.cam_out = self.device.getOutputQueue("cam_out", 1, False)
self.depth_out = self.device.getOutputQueue(name="disparity",maxSize=1,blocking=False)
self.face_in = self.device.getInputQueue("face_in",1,False)
self.face_nn = self.device.getOutputQueue("face_nn",1,False)
self.land_in = self.device.getInputQueue("land_in",1,False)
self.land_nn = self.device.getOutputQueue("land_nn",1,False)
self.reid_in = self.device.getInputQueue("reid_in",1,False)
self.reid_nn = self.device.getOutputQueue("reid_nn",1,False)`
My updated version is: depthai==0.0.2.1+47502febf3df4e8d022e1fc9dafd9435c5693e74
Looking forward to your answer, thank you.