You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/components/device.rst
+49-6Lines changed: 49 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,15 @@
3
3
Device
4
4
======
5
5
6
-
Device is a DepthAI `module <https://docs.luxonis.com/en/latest/pages/products/>`__. After the :ref:`Pipeline` is defined, it can be uploaded to the device.
7
-
When you create the device in the code, firmware is uploaded together with the pipeline.
6
+
Device represents an `OAK camera <https://docs.luxonis.com/projects/hardware/en/latest/>`__. On all of our devices there's a powerful vision processing unit
7
+
(**VPU**), called `Myriad X <https://www.intel.com/content/www/us/en/products/details/processors/movidius-vpu.html>`__.
8
+
The VPU is optimized for performing AI inference algorithms and for processing sensory inputs (eg. calculating stereo disparity from two cameras).
9
+
10
+
Device API
11
+
##########
12
+
13
+
:code:`Device` object represents an OAK device. When starting the device, you have to upload a :ref:`Pipeline` to it, which will get executed on the VPU.
14
+
When you create the device in the code, firmware is uploaded together with the pipeline and other assets (such as NN blobs).
8
15
9
16
.. code-block:: python
10
17
@@ -14,8 +21,10 @@ When you create the device in the code, firmware is uploaded together with the p
14
21
15
22
# Upload the pipeline to the device
16
23
with depthai.Device(pipeline) as device:
17
-
# Start the pipeline that is now on the device
18
-
device.startPipeline()
24
+
# Print Myriad X Id (MxID), USB speed, and available cameras on the device
When obtaining the output queue (example code below), the :code:`maxSize` and :code:`blocking` arguments should be set depending on how
78
+
the messages are intended to be used, where :code:`name` is the name of the outputting stream.
79
+
80
+
Since queues are on the host computer, memory (RAM) usually isn't that scarce. But if you are using a small SBC like RPI Zero, where there's only 0.5GB RAM,
Copy file name to clipboardExpand all lines: docs/source/components/messages.rst
+46-4Lines changed: 46 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,54 @@
3
3
Messages
4
4
========
5
5
6
-
Messages are sent between linked :ref:`Nodes`. The only way nodes communicate with each other is by sending messages from one to another.
6
+
Messages are sent between linked :ref:`Nodes`. The only way nodes communicate with each other is by sending messages from one to another. On the
7
+
table of contents (left side of the page) **all DepthAI messages are listed** under the :code:`Messages` entry. You can click on them to find out more.
7
8
8
-
If we have :code:`Node1` whose output is linked with :code:`Node2`'s input, a **message** is created in the :code:`Node1`,
9
-
sent out of the :code:`Node1`'s output and to the :code:`Node2`'s input.
9
+
.. rubric:: Creating a message in Script node
10
10
11
-
On the table of contents (left side of the page) all messages are listed under the :code:`Messages` entry. You can click on them to find out more.
11
+
A DepthAI message can be created either on the device, by a node automatically or manually inside the :ref:`Script` node. In below example,
12
+
the code is taken from the :ref:`Script camera control` example, where :ref:`CameraControl` is created inside the Script node every second
13
+
and sent to the :ref:`ColorCamera`'s input (:code:`cam.inputControl`).
14
+
15
+
.. code-block:: python
16
+
17
+
script = pipeline.create(dai.node.Script)
18
+
script.setScript("""
19
+
# Create a message
20
+
ctrl = CameraControl()
21
+
# Configure the message
22
+
ctrl.setCaptureStill(True)
23
+
# Send the message from the Script node
24
+
node.io['out'].send(ctrl)
25
+
""")
26
+
27
+
.. rubric:: Creating a message on a Host
28
+
29
+
It can also be created on a host computer and sent to the device via :ref:`XLinkIn` node. :ref:`RGB Camera Control`, :ref:`Video & MobilenetSSD`
30
+
and :ref:`Stereo Depth from host` code examples demonstrate this functionality perfectly. In the example below, we have removed all the code
31
+
that isn't relevant to showcase how a message can be created on the host and sent to the device via XLink.
32
+
33
+
.. code-block:: python
34
+
35
+
# Create XLinkIn node and configure it
36
+
xin = pipeline.create(dai.node.XLinkIn)
37
+
xin.setStreamName("frameIn")
38
+
xin.out.link(nn.input) # Connect it to NeuralNetwork's input
39
+
40
+
with dai.Device(pipeline) as device:
41
+
# Create input queue, which allows you to send messages to the device
42
+
qIn = device.getInputQueue("frameIn")
43
+
# Create ImgFrame message
44
+
img = dai.ImgFrame()
45
+
img.setData(frame)
46
+
img.setWidth(300)
47
+
img.setHeight(300)
48
+
qIn.send(img) # Send the message to the device
49
+
50
+
.. rubric:: Creating a message on an external MCU
51
+
52
+
A message can also be created on an external MCU and sent to the device via :ref:`SPIIn` node. An demo of such functionality is the
Copy file name to clipboardExpand all lines: docs/source/components/pipeline.rst
+11-43Lines changed: 11 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,36 +3,28 @@
3
3
Pipeline
4
4
========
5
5
6
-
Pipeline is a collection of :ref:`nodes <Nodes>` and links between them. This flow provides extensive flexibility that users get for their
7
-
DepthAI device.
8
-
6
+
Pipeline is a collection of :ref:`nodes <Nodes>` and links between them. This flow provides an extensive flexibility that users get for their
7
+
OAK device. When pipeline object is passed to the :ref:`Device` object, pipeline gets serialized to JSON and sent to the OAK device via XLink.
9
8
10
9
Pipeline first steps
11
10
####################
12
11
13
-
To get DepthAI up and running, one has to define a pipeline, populate it with nodes, configure the nodes and link them together. After that, the pipeline
12
+
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
14
13
can be loaded onto the :ref:`Device` and be started.
On this page you can find the details regarding the Gen2 DepthAI API that will allow you to interact with the DepthAI device.
13
-
We support both :ref:`Python API <Python API Reference>` and :ref:`C++ API <C++ API Reference>`
12
+
DepthAI API allows users to connect to, configure and communicate with their OAK devices.
13
+
We support both :ref:`Python API <Python API Reference>` and :ref:`C++ API <C++ API Reference>`.
14
14
15
-
What is Gen2?
16
-
-------------
15
+
.. image:: /_static/images/api_diagram.png
17
16
18
-
Gen2 is a step forward in DepthAI integration, allowing users to define their own flow of data using pipelines, nodes
19
-
and connections. Gen2 was created based on user's feedback from Gen1 and from raising capabilities of both DepthAI and
20
-
supporting software like OpenVINO.
21
-
22
-
Basic glossary
23
-
--------------
24
-
25
-
- **Host side** is the device, like PC or RPi, to which the DepthAI is connected to. If something is happening on the host side, it means that this device is involved in it, not DepthAI itself
26
-
27
-
- **Device side** is the DepthAI itself. If something is happening on the device side, it means that the DepthAI is responsible for it
28
-
29
-
- **Pipeline** is a complete workflow on the device side, consisting of nodes and connections between them - these cannot exist outside of pipeline.
30
-
31
-
- **Node** is a single functionality of the DepthAI. It have either inputs or outputs or both, together with properties to be defined (like resolution on the camera node or blob path in neural network node)
32
-
33
-
- **Connection** is a link between one node's output and another one's input. In order to define the pipeline dataflow, the connections define where to send data in order to achieve an expected result
34
-
35
-
- **XLink** is a middleware that is capable to exchange data between device and host. XLinkIn node allows to send the data from host to device, XLinkOut does the opposite.
17
+
- **Host side** is a computer, like PC or RPi, to which an OAK device is connected.
18
+
- **Device side** is the OAK device itself. If something is happening on the device side, it means that it's running on the `Myriad X VPU <https://www.intel.com/content/www/us/en/products/details/processors/movidius-vpu/movidius-myriad-x.html>`__. More :ref:`information here <components_device>`.
19
+
- **Pipeline** is a complete workflow on the device side, consisting of :ref:`nodes <Nodes>` and connections between them. More :ref:`information here <components_device>`.
20
+
- **Node** is a single functionality of the DepthAI. :ref:`Nodes` have inputs or outputs, and have configurable properties (like resolution on the camera node).
21
+
- **Connection** is a link between one node's output and another one's input. In order to define the pipeline dataflow, the connections define where to send `messages <Messages>` in order to achieve an expected result
22
+
- **XLink** is a middleware that is capable to exchange data between device and host. :ref:`XLinkIn` node allows sending the data from the host to a device, while :ref:`XLinkOut` does the opposite.
23
+
- **Messages** are transferred between nodes, as defined by a connection. More :ref:`information here <components_messages>`.
36
24
37
25
Getting started
38
26
---------------
39
27
40
-
To help you get started with Gen2 API, we have prepared multiple examples of it's usage, with more yet to come, together
41
-
with some insightful tutorials.
42
-
43
-
Before running the example, install the DepthAI Python library using the command below
First, you need to :ref:`install the DepthAI <Installation>` library and its dependencies.
50
29
51
-
Now, pick a tutorial or code sample and start utilizing Gen2 capabilities
30
+
After installation, you can continue with an insightful :ref:`Hello World tutorial <Hello World>`, or with :ref:`code examples <Code Samples>`, where different
31
+
node functionalities are presented with code.
52
32
53
33
.. toctree::
54
34
:maxdepth:0
@@ -57,7 +37,6 @@ Now, pick a tutorial or code sample and start utilizing Gen2 capabilities
0 commit comments