DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.
此页面由 AI 自动翻译。查看英文原版

本页目录

  • Pipeline 入门
  • 指定 OpenVINO 版本
  • 使用多个设备
  • 如何放置它
  • 参考

Pipeline

Pipeline 是一个由 节点 及其之间的链接组成的集合。 这种流程为用户提供了对其 OAK 设备的高度灵活性。当 pipeline 对象传递给 Device 对象时,pipeline 会被序列化为 JSON,并通过 XLink 发送到 OAK 设备。

Pipeline 入门

要开始使用 DepthAI,您必须创建一个 pipeline,用节点填充它,配置节点并将它们链接在一起。之后,pipeline 可以加载到 Device 上并启动。
Python
1pipeline = depthai.pipeline()
2
3# 如果需要,指定 OpenVINO 版本
4pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4)
5
6# 创建节点,配置它们并将它们链接在一起
7
8# 将 pipeline 上传到设备
9with depthai.Device(pipeline) as device:
10  # 设置输入/输出队列以通过 XLink 配置设备/主机通信...

指定 OpenVINO 版本

当使用未与 DepthAI 支持的最新 OpenVINO 编译的 NN blob 时,您必须指定 pipeline 的 OpenVINO 版本。 原因在于 OpenVINO 不会在 blob 中提供版本信息。
Python
1pipeline = depthai.pipeline()
2# 设置正确的版本:
3pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4)

使用多个设备

如果用户拥有多个 Luxonis 设备,每个设备可以运行不同的 pipeline,或者运行相同的 pipeline 演示在此)。要为每个设备使用不同的 pipeline, 您可以创建多个 pipeline,并在初始化时将所需的 pipeline 传递给所需的设备。 有关更多信息,请参阅 多设备设置

如何放置它

Python

Python
1pipeline = dai.Pipeline()

C++

C++
1dai::Pipeline pipeline;

参考

class

depthai.Pipeline

method
__init__(self)
Constructs a new pipeline
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
method
getCalibrationData(self) -> CalibrationHandler: CalibrationHandler
gets the calibration data which is set through pipeline  Returns:     the calibrationHandler with calib data in the pipeline
method
method
method
getDeviceConfig(self) -> Device.Config: Device.Config
Get device configuration needed for this pipeline
method
getGlobalProperties(self) -> GlobalProperties: GlobalProperties
Returns:     Global properties of current pipeline
method
method
getNodeMap(self) -> dict[int, Node]: dict[int, Node]
Get a reference to internal node map
method
getOpenVINOVersion(self) -> OpenVINO.Version: OpenVINO.Version
Get possible OpenVINO version to run this pipeline
method
method
method
remove(self, node: Node)
Removes a node from pipeline
method
serializeToJson(self) -> json: json
Returns whole pipeline represented as JSON
method
method
setCalibrationData(self, calibrationDataHandler: CalibrationHandler)
Sets the calibration in pipeline which overrides the calibration data in eeprom  Parameter ``calibrationDataHandler``:     CalibrationHandler object which is loaded with calibration information.
method
setCameraTuningBlobPath(self, path: Path)
Set a camera IQ (Image Quality) tuning blob, used for all cameras
method
setOpenVINOVersion(self, version: OpenVINO.Version)
Set a specific OpenVINO version to use with this pipeline
method
setSippBufferSize(self, sizeBytes: typing.SupportsInt)
SIPP (Signal Image Processing Pipeline) internal memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. By default memory is allocated in high speed CMX memory. Setting to 0 will allocate in DDR 256 kilobytes. Units are bytes.
method
setSippDmaBufferSize(self, sizeBytes: typing.SupportsInt)
SIPP (Signal Image Processing Pipeline) internal DMA memory pool. SIPP is a framework used to schedule HW filters, e.g. ISP, Warp, Median filter etc. Changing the size of this pool is meant for advanced use cases, pushing the limits of the HW. Memory is allocated in high speed CMX memory Units are bytes.
method
setXLinkChunkSize(self, sizeBytes: typing.SupportsInt)
Set chunk size for splitting device-sent XLink packets, in bytes. A larger value could increase performance, with 0 disabling chunking. A negative value won't modify the device defaults - configured per protocol, currently 64*1024 for both USB and Ethernet.
method