Skip to content

Commit 339f9b0

Browse files
authored
Merge branch 'main' into docker-compose-hotfix
2 parents 3a7b748 + bacba3d commit 339f9b0

File tree

61 files changed

+260
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+260
-303
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
brew install libusb
4949
python -m pip install git+git://github.com/luxonis/pybind11_mkdoc.git@master
5050
- name: Configure project
51-
run: cmake -S . -B build -DDEPTHAI_PYTHON_BUILD_DOCSTRINGS=ON -DDEPTHAI_PYTHON_FORCE_DOCSTRINGS=ON -DDEPTHAI_PYTHON_DOCSTRINGS_OUTPUT="$PWD/docstrings/depthai_python_docstring.hpp"
51+
run: cmake -S . -B build -DDEPTHAI_PYTHON_FORCE_DOCSTRINGS=ON -DDEPTHAI_PYTHON_DOCSTRINGS_OUTPUT="$PWD/docstrings/depthai_python_docstring.hpp"
5252
- name: Build target 'pybind11_mkdoc'
53-
run: cmake --build build --parallel --target pybind11_mkdoc
53+
run: cmake --build build --target pybind11_mkdoc --parallel
5454
- name: Upload docstring artifacts
5555
uses: actions/upload-artifact@v2
5656
with:
@@ -247,7 +247,7 @@ jobs:
247247
- name: Build and install depthai-core
248248
run: |
249249
cmake -S depthai-core/ -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
250-
cmake --build build_core --parallel --target install
250+
cmake --build build_core --target install --parallel
251251
echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV
252252
253253
- name: Append build hash if not a tagged commit
@@ -309,7 +309,7 @@ jobs:
309309
- name: Build and install depthai-core
310310
run: |
311311
cmake -S depthai-core/ -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
312-
cmake --build build_core --parallel --target install
312+
cmake --build build_core --target install --parallel
313313
echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV
314314
315315
- name: Append build hash if not a tagged commit

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ _builds/
2828

2929
#ci
3030
wheelhouse/
31+
32+
# Example blobs/files
33+
examples/models/

CMakeLists.txt

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,14 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/depthai-core/cmake")
3838
# Constants
3939
set(DOCSTRINGS_INCLUDE_PLACEHOLDER_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated/include)
4040
set(DOCSTRINGS_INCLUDE_PLACEHOLDER_PATH ${DOCSTRINGS_INCLUDE_PLACEHOLDER_DIR}/docstring.hpp)
41-
set(DOCSTRINGS_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/include/depthai_python_docstring.hpp)
41+
set(DEFAULT_DOCSTRINGS_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/depthai_python_docstring.hpp)
4242

4343
# First specify options
4444
option(DEPTHAI_PYTHON_USE_FIND_PACKAGE "Use find_package for depthai-core" OFF)
4545
option(DEPTHAI_PYTHON_ENABLE_TESTS "Enable tests" OFF)
4646
option(DEPTHAI_PYTHON_ENABLE_EXAMPLES "Enable examples" OFF)
4747
option(DEPTHAI_PYTHON_BUILD_DOCS "Build documentation - see docs/requirements.txt for needed dependencies" OFF)
4848
option(DEPTHAI_PYTHON_BUILD_DOCSTRINGS "Generate docstrings from header files if module 'pybind11_mkdoc' available" ON)
49-
set(DEPTHAI_PYTHON_DOCSTRINGS_INPUT ${DOCSTRINGS_OUTPUT} CACHE FILEPATH "Path to docstring for bindings")
50-
set(DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT ${DOCSTRINGS_OUTPUT} CACHE FILEPATH "Path where docstring file will be generated")
51-
if(DEPTHAI_PYTHON_BUILD_DOCSTRINGS)
52-
option(DEPTHAI_PYTHON_FORCE_DOCSTRINGS "Force that docstrings are generated, module 'pybind11_mkdoc' required" OFF)
53-
endif()
5449

5550
# Add external dependencies
5651
add_subdirectory(external)
@@ -89,22 +84,51 @@ pybind11_add_module(${TARGET_NAME}
8984
src/log/LogBindings.cpp
9085
)
9186

87+
88+
# Docstring options
89+
if(DEPTHAI_PYTHON_DOCSTRINGS_INPUT AND DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT)
90+
message(FATAL_ERROR "DEPTHAI_PYTHON_DOCSTRINGS_INPUT and DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT are mutually exclusive")
91+
endif()
92+
93+
if(DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT)
94+
# If output is specified set both input and output to same the path
95+
set(docstring_input_path ${DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT})
96+
set(docstring_output_path ${DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT})
97+
else()
98+
# If input docstrings explicitly specified, use those and disable building
99+
if(DEPTHAI_PYTHON_DOCSTRINGS_INPUT)
100+
set(docstring_input_path ${DEPTHAI_PYTHON_DOCSTRINGS_INPUT})
101+
message(STATUS "Disabled building of docstrings - using docstrings specified by DEPTHAI_PYTHON_DOCSTRINGS_INPUT (${DEPTHAI_PYTHON_DOCSTRINGS_INPUT})")
102+
set(DEPTHAI_PYTHON_BUILD_DOCSTRINGS OFF CACHE BOOL "Generate docstrings from header files if module 'pybind11_mkdoc' available" FORCE)
103+
else()
104+
# Otherwise set default location as input
105+
set(docstring_input_path ${DEFAULT_DOCSTRINGS_OUTPUT})
106+
endif()
107+
108+
# Set default output location
109+
set(docstring_output_path ${DEFAULT_DOCSTRINGS_OUTPUT})
110+
endif()
111+
112+
if(DEPTHAI_PYTHON_BUILD_DOCSTRINGS)
113+
option(DEPTHAI_PYTHON_FORCE_DOCSTRINGS "Force that docstrings are generated, module 'pybind11_mkdoc' required" OFF)
114+
endif()
115+
92116
# Configure include placeholder with INPUT path
93117
configure_file(cmake/docstring.hpp.in ${DOCSTRINGS_INCLUDE_PLACEHOLDER_PATH})
94118
# Add target to generate docstrings
95119
if (DEPTHAI_PYTHON_BUILD_DOCSTRINGS)
96120
include(pybind11-mkdoc)
97121

98122
# Check if pybind11_mkdoc available and create target
99-
target_pybind11_mkdoc_setup(${DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT} depthai::core ${DEPTHAI_PYTHON_FORCE_DOCSTRINGS})
123+
target_pybind11_mkdoc_setup(${docstring_output_path} depthai::core ${DEPTHAI_PYTHON_FORCE_DOCSTRINGS})
100124

101125
if(NOT TARGET pybind11_mkdoc)
102126
# Generate default docstrings to OUTPUT path
103-
configure_file(cmake/default_docstring.hpp.in ${DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT} COPYONLY)
127+
configure_file(cmake/default_docstring.hpp.in ${docstring_output_path} COPYONLY)
104128
endif()
105129
else()
106130
# Generate default docstrings to OUTPUT path
107-
configure_file(cmake/default_docstring.hpp.in ${DEPTHAI_PYTHON_DOCSTRINGS_OUTPUT} COPYONLY)
131+
configure_file(cmake/default_docstring.hpp.in ${docstring_output_path} COPYONLY)
108132
endif()
109133

110134
# Add include directory

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,22 @@ See: [depthai-core dependencies](https://github.com/luxonis/depthai-core#depende
3434
To build a shared library from source perform the following:
3535
```
3636
mkdir build && cd build
37-
cmake ..
37+
cmake .. [-D PYTHON_EXECUTABLE=/full/path/to/python]
3838
cmake --build . --parallel
3939
```
4040

41+
Where `-D PYTHON_EXECUTABLE` option can optionally specify an exact Python executable to use for building.
42+
4143
To build a wheel, execute the following
4244
```
4345
python3 -m pip wheel . -w wheelhouse
4446
```
4547

48+
To build and install using pip:
49+
```
50+
python3 -m pip install .
51+
```
52+
4653
## Running tests
4754

4855
To run the tests build the library with the following options

cmake/docstring.hpp.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "@DEPTHAI_PYTHON_DOCSTRINGS_INPUT@"
1+
#include "@docstring_input_path@"

docs/docker/update_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
cmake --build build --parallel --target sphinx
5+
cmake --build build --target sphinx --parallel
66

77
# fix missing index.css file
88
cp /app/docs/source/_static/css/* /app/build/docs/sphinx/_static/css

docs/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ Now, pick a tutorial or code sample and start utilizing Gen2 capabilities
9090
samples/16_device_queue_event.rst
9191
samples/17_video_mobilenet.rst
9292
samples/18_rgb_encoding_mobilenet.rst
93-
samples/21_mobilenet_decoding_on_device.rst
9493
samples/22_1_tiny_yolo_v3_decoding_on_device.rst
9594
samples/22_2_tiny_yolo_v4_decoding_on_device.rst
9695
samples/23_autoexposure_roi.rst

docs/source/install.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Supported Platforms
1616

1717
We keep up-to-date, pre-compiled, libraries for the following platforms. Note that a new change is that for Ubuntu now also work unchanged for the Jetson/Xavier series:
1818

19-
======================== =========================================== ================================================= ================================================================================
20-
Platform Instructions Tutorial Support
21-
======================== =========================================== ================================================= ================================================================================
22-
Windows 10 :ref:`Platform dependencies <Windows>` `Video tutorial <https://youtu.be/ekopKJfcWiE>`__ `Discord <https://discord.com/channels/790680891252932659/798284448323731456>`__
23-
macOS :ref:`Platform dependencies <macOS>` `Video tutorial <https://youtu.be/0RGmmjed3Hc>`__ `Discord <https://discord.com/channels/790680891252932659/798283911989690368>`__
24-
Ubuntu & Jetson/Xavier :ref:`Platform dependencies <Ubuntu>` `Video tutorial <https://youtu.be/QXeXMaxj4cM>`__ `Discord <https://discord.com/channels/790680891252932659/798302162160451594>`__
25-
Raspberry Pi :ref:`Platform dependencies <Raspberry Pi>` `Video tutorial <https://youtu.be/BpUMT-xqwqE>`__ `Discord <https://discord.com/channels/790680891252932659/798302708070350859>`__
26-
======================== =========================================== ================================================= ================================================================================
19+
======================== ============================================== ================================================================================
20+
Platform Instructions Support
21+
======================== ============================================== ================================================================================
22+
Windows 10 :ref:`Platform dependencies <Windows>` `Discord <https://discord.com/channels/790680891252932659/798284448323731456>`__
23+
macOS :ref:`Platform dependencies <macOS>` `Discord <https://discord.com/channels/790680891252932659/798283911989690368>`__
24+
Ubuntu & Jetson/Xavier :ref:`Platform dependencies <Ubuntu>` `Discord <https://discord.com/channels/790680891252932659/798302162160451594>`__
25+
Raspberry Pi OS :ref:`Platform dependencies <Raspberry Pi OS>` `Discord <https://discord.com/channels/790680891252932659/798302708070350859>`__
26+
======================== ============================================== ================================================================================
2727

2828
And the following platforms are also supported by a combination of the community and Luxonis.
2929

docs/source/samples/04_rgb_encoding.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ encoded video over XLINK to the host, saving it to disk as a video file.
99
Pressing Ctrl+C will stop the recording and then convert it using ffmpeg into an mp4 to make it
1010
playable. Note that ffmpeg will need to be installed and runnable for the conversion to mp4 to succeed.
1111

12-
Be careful, this example saves encoded video to your host storage. So if you leave them running,
12+
Be careful, this example saves encoded video to your host storage. So if you leave it running,
1313
you could fill up your storage on your host.
1414

1515

0 commit comments

Comments
 (0)