Software Stack
DepthAI

ON THIS PAGE

  • Visualizer YOLO
  • Pipeline
  • Source code

Visualizer YOLO

The example sets up a DepthAI pipeline to stream YOLOv6-Nano object detection results and 512x288 NV12 camera using RemoteConnection, enabling remote visualization.This example requires the DepthAI v3 API, see installation instructions.

Pipeline

Source code

Python
C++

Python

Python
GitHub
1#!/usr/bin/env python3
2import depthai as dai
3from argparse import ArgumentParser
4
5parser = ArgumentParser()
6parser.add_argument("--webSocketPort", type=int, default=8765)
7parser.add_argument("--httpPort", type=int, default=8080)
8args = parser.parse_args()
9
10remoteConnector = dai.RemoteConnection(webSocketPort=args.webSocketPort, httpPort=args.httpPort)
11# Create pipeline
12with dai.Pipeline() as pipeline:
13    cameraNode = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_A)
14    detectionNetwork = pipeline.create(dai.node.DetectionNetwork).build(
15        cameraNode, dai.NNModelDescription("yolov6-nano")
16    )
17
18    remoteConnector.addTopic("detections", detectionNetwork.out, "img")
19    remoteConnector.addTopic("images", detectionNetwork.passthrough, "img")
20
21    pipeline.start()
22    remoteConnector.registerPipeline(pipeline)
23
24    while pipeline.isRunning():
25        key = remoteConnector.waitKey(1)
26        if key == ord("q"):
27            print("Got q key from the remote connection!")
28            break

Need assistance?

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