Hi,
I believe I’ve successfully combined the object detection pipeline (using the .tar.xz model) with POE-TCP streaming. When I run:python3 host.py client <ip_address>
I do receive the camera stream on the host side, so it seems the code is running correctly. However, I’m not seeing any bounding boxes overlaid on the video—even though object detection appears to be active on the device.
Could this be a directory or model linking issue? Or is there anything else I might have missed in the pipeline setup?
Any suggestions or debugging tips would be appreciated!
Thanks!
`from pathlib import Path
import depthai as dai
from utils.oak_arguments import initialize_argparser
from utils.scripts import get_client_script, get_server_script
from utils.annotation_node import AnnotationNode
_, args = initialize_argparser()
device = dai.Device(dai.DeviceInfo(args.device)) if args.device else dai.Device()
with dai.Pipeline(device) as pipeline:
print("Creating pipeline...")
platform = pipeline.getDefaultDevice().getPlatformAsString()
nn_archive = dai.NNArchive("/app/utils/yolov6n-r2-288x512.rvc4.tar.xz")
if args.media_path:
replay = pipeline.create(dai.node.ReplayVideo)
replay.setReplayVideoFile(Path(args.media_path))
replay.setOutFrameType(
dai.ImgFrame.Type.BGR888p if platform == "RVC4" else dai.ImgFrame.Type.BGR888i
)
replay.setLoop(True)
replay.setFps(args.fps_limit)
replay.setSize(1920, 1440)
cam_out = replay.out
else:
available = device.getConnectedCameras()
if len(available) < 3:
raise ValueError(
"Device must have 3 cameras (color, left and right) in order to run this experiment."
)
cam = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_A)
cam_out = cam.requestOutput((1920, 1440), fps=args.fps_limit)
left_cam = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_B)
right_cam = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_C)
stereo = pipeline.create(dai.node.StereoDepth).build(
left= left_cam.requestOutput(nn_archive.getInputSize()),
right= right_cam.requestOutput(nn_archive.getInputSize()),
presetMode=dai.node.StereoDepth.PresetMode.HIGH_DETAIL,
)
stereo.setDepthAlign(dai.CameraBoardSocket.CAM_A)
if platform == "RVC2":
stereo.setOutputSize(*nn_archive.getInputSize())
stereo.setLeftRightCheck(True)
stereo.setRectification(True)
nn = pipeline.create(dai.node.SpatialDetectionNetwork).build(
input=cam,
stereo=stereo,
nnArchive=nn_archive,
fps=float(args.fps_limit),
)
if platform == "RVC2":
nn.setNNArchive(nn_archive, numShaves=7)
nn.setBoundingBoxScaleFactor(0.7)
annotation_node = pipeline.create(AnnotationNode).build(
input_detections=nn.out,
labels=nn_archive.getConfig().model.heads[0].metadata.classes,
)
video_enc = pipeline.create(dai.node.VideoEncoder).build(
cam_out,
frameRate=args.fps_limit,
profile=dai.VideoEncoderProperties.Profile.MJPEG,
)
script = pipeline.create(dai.node.Script)
script.setProcessor(dai.ProcessorType.LEON_CSS)
video_enc.bitstream.link(script.inputs["frame"])
script.inputs["frame"].setBlocking(False)
script.inputs["frame"].setMaxSize(1)
if args.mode == "client":
script.setScript(get_client_script(args.address))
else:
script.setScript(get_server_script())
if not args.media_path:
script.outputs["control"].link(cam.inputControl)
print("Pipeline created.")
pipeline.run() `