Pipeline is a collection of nodes <Nodes>
and links between them. This flow provides an extensive flexibility that users get for their OAK device. When pipeline object is passed to the Device
object, pipeline gets serialized to JSON and sent to the OAK device via XLink.
To get DepthAI up and running, you have to create a pipeline, populate it with nodes, configure the nodes and link them together. After that, the pipeline can be loaded onto the Device
and be started.
pipeline = depthai.Pipeline()
# If required, specify OpenVINO version
pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4)
# Create nodes, configure them and link them together
# Upload the pipeline to the device
with depthai.Device(pipeline) as device:
# Set input/output queues to configure device/host communication through the XLink...
When using a NN blob that was not compiled with the latest OpenVINO (that DepthAI supports), you have to specify the OpenVINO version of the pipeline. The reason behind this is that OpenVINO doesn't provide version inside the blob.
pipeline = depthai.Pipeline()
# Set the correct version:
pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4)
If user has multiple DepthAI devices, each device can run a different pipeline or the same pipeline (demo here). To use different pipeline for each device, you can create multiple pipelines and pass the desired pipeline to the desired device on initialization.
py
pipeline = dai.Pipeline()
c++
dai::Pipeline pipeline;
Python
depthai.Pipeline
C++
dai::Pipeline