此页面由 AI 自动翻译。查看英文原版

本页目录

  • Pipeline 入门
  • 使用多台设备
  • 如何放置它
  • 参考

Pipeline

Pipeline 是 Nodes 的集合以及它们之间的链接。 这种流程为用户提供了对其 OAK 设备的高度灵活性。

Pipeline 入门

要启动并运行 DepthAI,您必须创建一个管道,用节点填充它,配置节点并将它们链接在一起。之后,管道可以加载到 Device 上并启动。
Python
1with dai.Pipeline() as pipeline:
2
3  # 创建节点,配置它们并将它们链接在一起
4  ...
5
6  # 将管道上传到设备
7  pipeline.start()

使用多台设备

如果用户有多台 Luxonis 设备,每台设备都可以运行不同的管道或相同的管道。 有关更多信息,请参阅 多设备设置

如何放置它

Python

Python
1pipeline = dai.Pipeline() # 尽管我们通常更喜欢使用上下文管理器(with 语句)

C++

C++
1dai::Pipeline pipeline;

参考

class

dai::Pipeline

#include Pipeline.hpp
inline function
PipelineImpl * impl()
inline function
const PipelineImpl * impl()
inline function
std::vector< std::shared_ptr< Node > > getSourceNodes()
explicit function
Pipeline(bool createImplicitDevice)
Creates a pipeline
Parameters
  • createImplicitDevice: If true, creates a default device (default = true)
explicit function
Pipeline(std::shared_ptr< Device > device)
Creates a pipeline with specified device
explicit function
Pipeline(std::shared_ptr< PipelineImpl > pimpl)
Creates a pipeline with specified device
inline function
GlobalProperties getGlobalProperties()
Returns
Global properties of current pipeline
inline function
void setGlobalProperties(GlobalProperties globalProperties)
Sets global properties of pipeline
inline function
void setDefaultDeviceProperties(DeviceProperties deviceProperties)
Sets default device properties
inline function
void setDefaultDevicePropertiesRef(DeviceProperties * deviceProperties)
Sets default device properties reference. The properties should live at least as long as the pipeline.
inline function
std::optional< DeviceProperties > getDefaultDeviceProperties()
Gets a copy of default device properties. If pipeline is in host only mode, returns host properties, otherwise returns device properties
function
PipelineSchema getPipelineSchema(SerializationType type, bool includePipelineDebugging)
Returns
Pipeline schema
function
PipelineSchema getDevicePipelineSchema(SerializationType type, bool includePipelineDebugging)
Returns
Device pipeline schema (without host only nodes and connections)
inline function
void serialize(PipelineSchema & schema, Assets & assets, std::vector< std::uint8_t > & assetStorage)
inline function
nlohmann::json serializeToJson(bool includeAssests)
inline function
std::shared_ptr< N > create(Args &&... args)
Creates and adds a node to the pipeline.Node is specified by template argument N
inline function
void add(std::shared_ptr< Node > node)
Adds an existing node to the pipeline
inline function
void remove(std::shared_ptr< Node > node)
inline function
std::vector< std::shared_ptr< Node > > getAllNodes()
inline function
std::shared_ptr< const Node > getNode(Node::Id id)
inline function
std::shared_ptr< Node > getNode(Node::Id id)
inline function
std::vector< Node::Connection > getConnections()
inline function
NodeConnectionMap getConnectionMap()
inline function
const AssetManager & getAssetManager()
inline function
AssetManager & getAssetManager()
inline function
void setOpenVINOVersion(OpenVINO::Version version)
inline function
void setCalibrationData(CalibrationHandler calibrationDataHandler)
Sets the calibration in pipeline which overrides the calibration data in eeprom
Parameters
  • calibrationDataHandler: CalibrationHandler object which is loaded with calibration information.
inline function
CalibrationHandler getCalibrationData()
gets the calibration data which is set through pipeline
Returns
the calibrationHandler with calib data in the pipeline
inline function
bool isCalibrationDataAvailable()
check if calib data is available on the device
Returns
true - calib data is available
Returns
false - calib data is not available
inline function
std::optional< EepromData > getEepromData()
gets the eeprom data from the pipeline
Returns
eepromData from the the pipeline
inline function
void setEepromData(std::optional< EepromData > eepromData)
Sets the eeprom data in pipeline
Parameters
  • eepromData: EepromData object that is loaded in the pipeline.
inline function
uint32_t getEepromId()
Gets the eeprom id from the pipeline
Returns
eeprom id from the pipeline
inline function
void setCameraTuningBlobPath(const fs::path & path)
inline function
void setCameraTuningBlobPath(CameraBoardSocket socket, const fs::path & path)
inline function
void setXLinkChunkSize(int sizeBytes)
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.
inline function
void setSippBufferSize(int sizeBytes)
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.
inline function
void setSippDmaBufferSize(int sizeBytes)
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.
inline function
void setBoardConfig(BoardConfig board)
inline function
void setAutoCalibration(AutoCalibrationMode mode)
inline function
AutoCalibrationMode getAutoCalibration()
inline function
void setAutoCalibrationMode(AutoCalibrationMode mode)
inline function
AutoCalibrationMode getAutoCalibrationMode()
inline function
BoardConfig getBoardConfig()
inline function
Device::Config getDeviceConfig()
inline function
bool isRunning()
inline function
bool isBuilt()
inline function
void build()
inline function
void buildDevice()
inline function
void start()
inline function
void wait()
inline function
void stop()
inline function
void processTasks(bool waitForTasks, double timeoutSeconds)
inline function
void run()
inline function
std::shared_ptr< Device > getDefaultDevice()
inline function
void addTask(std::function< void()> task)
function
void enableHolisticRecord(const RecordConfig & config)
function
void enableHolisticReplay(const std::string & pathToRecording)
function
bool isHolisticRecordEnabled()
function
bool isHolisticReplayEnabled()
function
void enablePipelineDebugging(bool enable)
function
bool isPipelineDebuggingEnabled()
function
std::shared_ptr< MessageQueue > getPipelineStateOut()
function
std::shared_ptr< InputQueue > getPipelineStateRequest()
function
PipelineStateApi getPipelineState()
enum

PipelineAutoCalibrationMode AutoCalibrationMode

enum

PipelineImpl::NodeConnectionMap NodeConnectionMap