Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Now, pick a tutorial or code sample and start utilizing Gen2 capabilities
samples/16_device_queue_event.rst
samples/17_video_mobilenet.rst
samples/18_rgb_encoding_mobilenet.rst
samples/21_mobilenet_decoding_on_device.rst
samples/22_1_tiny_yolo_v3_decoding_on_device.rst
samples/22_2_tiny_yolo_v4_decoding_on_device.rst
samples/23_autoexposure_roi.rst
Expand Down
2 changes: 1 addition & 1 deletion docs/source/samples/09_mono_mobilenet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Demo
.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/liTGGyJwZ_8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
<iframe src="https://www.youtube.com/embed/8Jih63NWFdI" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

Setup
Expand Down
6 changes: 3 additions & 3 deletions docs/source/samples/10_mono_depth_mobilenetssd.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
10 - Mono & MobilenetSSD & Encoding
===================================
10 - Mono & MobilenetSSD & Depth
================================

This example shows how to run MobileNetv2SSD on the left grayscale camera in parallel with running
the disparity depth results, displaying both the depth map and the right grayscale stream, with the
Expand All @@ -11,7 +11,7 @@ Demo
.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/D_hefNl134M" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
<iframe src="https://www.youtube.com/embed/aCT0CRXx1qI" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

Setup
Expand Down
2 changes: 1 addition & 1 deletion docs/source/samples/11_rgb_encoding_mono_mobilenet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Demo
.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/qzwt9XXNsow" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
<iframe src="https://www.youtube.com/embed/3n549_6dANo" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

Setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Demo
.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/Yeuzo1H24KQ" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
<iframe src="https://www.youtube.com/embed/3sijxVDVFY8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

Setup
Expand Down
2 changes: 1 addition & 1 deletion docs/source/samples/15_rgb_mobilenet_4k.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Demo
.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/Ww-vLSxOdW8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
<iframe src="https://www.youtube.com/embed/4CWPVCeynw8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>


Expand Down
4 changes: 2 additions & 2 deletions docs/source/samples/17_video_mobilenet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Demo
.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/T8kipWWdq98" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
<iframe src="https://www.youtube.com/embed/4DVzHw1f8p8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>


Expand All @@ -23,7 +23,7 @@ Setup

This example also requires MobilenetSDD blob (:code:`mobilenet.blob` file) and prerecorded video
(:code:`construction_vest.mp4` file) to work - you can download them
here: `mobilenet.blob <https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.2_6shave.blob>`__
here: `mobilenet.blob <https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.2_8shave.blob>`__
and `construction_vest.mp4 <https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/construction_vest.mp4>`__

Source code
Expand Down
2 changes: 1 addition & 1 deletion docs/source/samples/18_rgb_encoding_mobilenet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Demo
.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/tE_glawKIho" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
<iframe src="https://www.youtube.com/embed/ZFc_w5zKLPg" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

Setup
Expand Down
33 changes: 1 addition & 32 deletions docs/source/samples/21_mobilenet_decoding_on_device.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1 @@
21 - RGB & MobilenetSSD decoding on device
==========================================

This example shows how to run MobileNetv2SSD on the RGB input frame, and how to display both the RGB
preview and the metadata results from the MobileNetv2SSD on the preview. It's similar to example '08_rgb_mobilenet' except
decoding is done on Myriad instead on the host.


setConfidenceThreshold - confidence threshold above which objects are detected

Demo
####


Setup
#####

.. include:: /includes/install_from_pypi.rst

This example also requires MobilenetSDD blob (:code:`mobilenet.blob` file) to work - you can download it from
`here <https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.2_6shave.blob>`__

Source code
###########

Also `available on GitHub <https://github.com/luxonis/depthai-python/blob/main/examples/21_mobilenet_device_side_decoding.py>`__

.. literalinclude:: ../../../examples/21_mobilenet_device_side_decoding.py
:language: python
:linenos:

.. include:: /includes/footer-short.rst
This example was moved to :ref:`08 - RGB & MobilenetSSD`
6 changes: 6 additions & 0 deletions docs/source/samples/22_1_tiny_yolo_v3_decoding_on_device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ setConfidenceThreshold - confidence threshold above which objects are detected
Demo
####

.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/2zXyYzD7ESQ" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>


Setup
#####
Expand Down
6 changes: 6 additions & 0 deletions docs/source/samples/22_2_tiny_yolo_v4_decoding_on_device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ setConfidenceThreshold - confidence threshold above which objects are detected
Demo
####

.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/l4jDLs9d8GI" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>


Setup
#####
Expand Down
9 changes: 9 additions & 0 deletions docs/source/samples/24_opencv_support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ This example shows API which exposes both numpy and OpenCV compatible image type
It uses ColorCamera node to retrieve both BGR interleaved 'preview' and NV12 encoded 'video' frames.
Both are displayed using functions `getFrame` and `getCvFrame`.

Demo
####

.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/YyhUivHFsaU" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

Setup
#####

Expand Down
37 changes: 37 additions & 0 deletions docs/source/samples/25_system_information.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,43 @@

This example shows how to get system information (memory usage, cpu usage and temperature) from the board.

Demo
####

Example script output

.. code-block::

Drr used / total - 0.13 / 414.80 MiB
Cmx used / total - 2.24 / 2.50 MiB
LeonCss heap used / total - 4.17 / 46.41 MiB
LeonMss heap used / total - 2.87 / 27.58 MiB
Chip temperature - average: 38.59, css: 39.81, mss: 37.71, upa0: 38.65, upa1: 38.18
Cpu usage - Leon OS: 7.08%, Leon RT: 1.48 %
----------------------------------------
Drr used / total - 0.13 / 414.80 MiB
Cmx used / total - 2.24 / 2.50 MiB
LeonCss heap used / total - 4.17 / 46.41 MiB
LeonMss heap used / total - 2.87 / 27.58 MiB
Chip temperature - average: 38.59, css: 39.58, mss: 37.94, upa0: 38.18, upa1: 38.65
Cpu usage - Leon OS: 1.55%, Leon RT: 0.30 %
----------------------------------------
Drr used / total - 0.13 / 414.80 MiB
Cmx used / total - 2.24 / 2.50 MiB
LeonCss heap used / total - 4.17 / 46.41 MiB
LeonMss heap used / total - 2.87 / 27.58 MiB
Chip temperature - average: 38.94, css: 40.04, mss: 38.18, upa0: 39.35, upa1: 38.18
Cpu usage - Leon OS: 0.56%, Leon RT: 0.06 %
----------------------------------------
Drr used / total - 0.13 / 414.80 MiB
Cmx used / total - 2.24 / 2.50 MiB
LeonCss heap used / total - 4.17 / 46.41 MiB
LeonMss heap used / total - 2.87 / 27.58 MiB
Chip temperature - average: 39.46, css: 40.28, mss: 38.88, upa0: 39.81, upa1: 38.88
Cpu usage - Leon OS: 0.51%, Leon RT: 0.06 %
----------------------------------------


Setup
#####

Expand Down
6 changes: 6 additions & 0 deletions docs/source/samples/26_1_spatial_mobilenet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ setConfidenceThreshold - confidence threshold above which objects are detected
Demo
####

.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/oM95Lz3aGkc" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>


Setup
#####
Expand Down
8 changes: 7 additions & 1 deletion docs/source/samples/26_2_spatial_mobilenet_mono.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
26.2 - MONO & MobilenetSSD with spatial data
26.2 - Mono & MobilenetSSD with spatial data
============================================

This example shows how to run MobileNetv2SSD on the rectified right input frame, and
Expand All @@ -11,6 +11,12 @@ setConfidenceThreshold - confidence threshold above which objects are detected
Demo
####

.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/SZz7NwM86uw" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>


Setup
#####
Expand Down
6 changes: 6 additions & 0 deletions docs/source/samples/26_3_spatial_tiny_yolo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ setConfidenceThreshold - confidence threshold above which objects are detected
Demo
####

.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/93tG_qBweN8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>


Setup
#####
Expand Down
9 changes: 9 additions & 0 deletions docs/source/samples/28_camera_video_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
This example shows how to use high resolution video at low latency. Compared to :ref:`01 - RGB Preview`, this demo outputs NV12 frames whereas
preview frames are BGR and are not suited for larger resoulution (eg. 2000x1000). Preview is more suitable for either NN or visualization purposes.

Demo
####

.. raw:: html

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/-sTQLEVvO38" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>

Setup
#####

Expand Down
12 changes: 6 additions & 6 deletions examples/12_rgb_encoding_mono_mobilenet_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
camRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)

depth = pipeline.createStereoDepth()
depth.setConfidenceThreshold(200)
depth.setConfidenceThreshold(255)
# Note: the rectified streams are horizontally mirrored by default
depth.setOutputRectified(True)
depth.setRectifyEdgeFillColor(0) # Black, to better see the cutout
Expand Down Expand Up @@ -80,11 +80,11 @@
# Start pipeline
device.startPipeline()

queue_size = 8
qRight = device.getOutputQueue("right", queue_size)
qDepth = device.getOutputQueue("depth", queue_size)
qManip = device.getOutputQueue("manip", queue_size)
qDet = device.getOutputQueue("nn", queue_size)
queueSize = 8
qRight = device.getOutputQueue("right", queueSize)
qDepth = device.getOutputQueue("depth", queueSize)
qManip = device.getOutputQueue("manip", queueSize)
qDet = device.getOutputQueue("nn", queueSize)
qRgbEnc = device.getOutputQueue('h265', maxSize=30, blocking=True)

frame = None
Expand Down
47 changes: 42 additions & 5 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,65 @@ TEST_TIMEOUT=0 ctest -R "01_rgb_preview" --verbose
![example_7](https://user-images.githubusercontent.com/5244214/104040905-86209480-51d8-11eb-9e15-5fe94aba7b69.gif)

### 08_rgb_mobilenet.py
![example_8](https://user-images.githubusercontent.com/5244214/112524084-b58a7a80-8d9f-11eb-9389-e17b0ea40338.gif)
![example_8](https://user-images.githubusercontent.com/5244214/112838840-cb4cb800-909d-11eb-8264-83d3c1e5f348.gif)

### 09_mono_mobilenet.py
![example_9](https://user-images.githubusercontent.com/5244214/104040898-8456d100-51d8-11eb-9498-e316b71d41e6.gif)
![example_9](https://user-images.githubusercontent.com/5244214/112838832-ca1b8b00-909d-11eb-8ea1-eafeb98c3266.gif)

### 10_mono_depth_mobilenetssd.py

**NOTE** For clearness, a `disparity` output is used instead of `depth`, as disparity is better to visualize

![example_10](https://user-images.githubusercontent.com/5244214/104056108-35b53100-51f0-11eb-9677-63e5fb5bcb83.gif)
![example_10](https://user-images.githubusercontent.com/5244214/112838828-c8ea5e00-909d-11eb-912a-ce3995a68bfd.gif)

### 11_rgb_encoding_mono_mobilenet.py
![example_11](https://user-images.githubusercontent.com/5244214/104740909-cb007a00-5748-11eb-8250-c07ee6bf980a.gif)
![example_11](https://user-images.githubusercontent.com/5244214/112838821-c851c780-909d-11eb-86d4-d7a6b6d0aebe.gif)

### 12_rgb_encoding_mono_mobilenet_depth.py

**NOTE** For clearness, a `disparity` output is used instead of `depth`, as disparity is better to visualize

![example_12](https://user-images.githubusercontent.com/5244214/104741001-e9667580-5748-11eb-92d3-39dd726b0992.gif)
![example_12](https://user-images.githubusercontent.com/5244214/112838818-c7209a80-909d-11eb-8f50-81c023c59e9b.gif)

### 13_encoding_max_limit.py
![example_13](https://user-images.githubusercontent.com/5244214/104741072-0307bd00-5749-11eb-97f3-9422c8b0d8da.gif)

### 14_color_camera_control.py
![example_14](https://user-images.githubusercontent.com/5244214/104741150-187ce700-5749-11eb-8bd5-3d4f37d2d22a.gif)

### 15_rgb_mobilenet_4k.py
![15](https://user-images.githubusercontent.com/5244214/112838812-c556d700-909d-11eb-8194-83602530c9af.gif)

### 16_device_queue_event.py
![16](https://user-images.githubusercontent.com/5244214/112838810-c425aa00-909d-11eb-9962-550533f13268.gif)

### 17_video_mobilenet.py
![17](https://user-images.githubusercontent.com/5244214/112838807-c38d1380-909d-11eb-9c89-878eaa20e4ed.gif)

### 18_rgb_encoding_mobilenet.py
![18](https://user-images.githubusercontent.com/5244214/112838805-c25be680-909d-11eb-8db2-2d0ce61aebe0.gif)

### 22_1_tiny_yolo_v3_device_side_decoding.py
![22_1](https://user-images.githubusercontent.com/5244214/112838798-c12ab980-909d-11eb-8e6c-5aa3d623c7e9.gif)

### 22_2_tiny_yolo_v4_device_side_decoding.py
![22_2](https://user-images.githubusercontent.com/5244214/112838790-bff98c80-909d-11eb-8b85-7c4dbd9a0e62.gif)

### 23_autoexposure_roi.py
![23](https://user-images.githubusercontent.com/5244214/112838784-be2fc900-909d-11eb-8067-291636ae9950.gif)

### 24_opencv_support.py
![24](https://user-images.githubusercontent.com/5244214/112838789-bf60f600-909d-11eb-9fb5-203dbec774f8.gif)

### 26_1_spatial_mobilenet.py
![26_1](https://user-images.githubusercontent.com/5244214/112838781-bcfe9c00-909d-11eb-9d12-a9834f545271.gif)

### 26_2_spatial_mobilenet_mono.py
![26_2](https://user-images.githubusercontent.com/5244214/112838777-bbcd6f00-909d-11eb-9b1e-d93159c3d88f.gif)

### 26_3_spatial_tiny_yolo.py
![26_3](https://user-images.githubusercontent.com/5244214/112838772-ba9c4200-909d-11eb-9678-0703df46b529.gif)

### 28_camera_video_example.py
![28](https://user-images.githubusercontent.com/5244214/112838767-b8d27e80-909d-11eb-92f0-5af20c4326b7.gif)