Skip to content

Commit 7585d3e

Browse files
committed
Merge 'origin/develop' into ir_frame_control
2 parents 31578b7 + 4608394 commit 7585d3e

File tree

173 files changed

+7212
-3320
lines changed

Some content is hidden

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

173 files changed

+7212
-3320
lines changed

.github/workflows/docker-hub.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest, ARM, ARM64]
16+
os: [ubuntu-latest, [Linux, ARM], [Linux, ARM64]]
1717
include:
1818
- os: ubuntu-latest
1919
arch: amd64
20-
- os: ARM
20+
- os: [Linux, ARM]
2121
arch: armv7
22-
- os: ARM64
22+
- os: [Linux, ARM64]
2323
arch: armv8
2424
steps:
2525
- name: Clean the workspace

.github/workflows/main.yml

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
needs: build-docstrings
6868
strategy:
6969
matrix:
70-
os: [ubuntu-latest, windows-2019, macos-latest]
70+
os: [ubuntu-latest, windows-latest, macos-latest]
7171
runs-on: ${{ matrix.os }}
7272
steps:
7373
- name: Print home directory
@@ -177,6 +177,7 @@ jobs:
177177
matrix:
178178
python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
179179
python-architecture: [x64, x86]
180+
fail-fast: false
180181
steps:
181182
- name: Cache .hunter folder
182183
uses: actions/cache@v2
@@ -230,14 +231,17 @@ jobs:
230231
strategy:
231232
matrix:
232233
python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
234+
fail-fast: false
233235
steps:
234236
- name: Cache .hunter folder
235237
uses: actions/cache@v2
236238
with:
237239
path: ~/.hunter
238240
key: hunter-macos-latest
239241
- name: List .hunter cache directory
240-
run: ls -a -l ~/.hunter/_Base/ || true
242+
run: |
243+
ls -a -l ~/.hunter/_Base/ || true
244+
echo "PATH=$PATH"
241245
242246
- uses: actions/checkout@v2
243247
with:
@@ -281,6 +285,63 @@ jobs:
281285
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
282286
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}
283287

288+
# This job builds wheels for macOS arm64 arch
289+
build-macos-arm64:
290+
needs: build-docstrings
291+
runs-on: [self-hosted, macOS, ARM64]
292+
steps:
293+
# Cached locally on runner
294+
# - name: Cache .hunter folder
295+
# uses: actions/cache@v2
296+
# with:
297+
# path: ~/.hunter
298+
# key: hunter-macos-latest
299+
- name: List .hunter cache directory
300+
run: |
301+
ls -a -l ~/.hunter/_Base/ || true
302+
echo "PATH=$PATH"
303+
304+
- uses: actions/checkout@v2
305+
with:
306+
submodules: 'recursive'
307+
308+
- uses: actions/download-artifact@v2
309+
with:
310+
name: 'docstrings'
311+
path: docstrings
312+
- name: Specify docstring to use while building the wheel
313+
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
314+
315+
- name: Append build hash if not a tagged commit
316+
if: startsWith(github.ref, 'refs/tags/v') != true
317+
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
318+
319+
# - name: Build and install depthai-core
320+
# run: |
321+
# echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV
322+
# cmake -S depthai-core/ -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
323+
# cmake --build build_core --target install --parallel 4
324+
# echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV
325+
326+
- name: Build wheels
327+
run: for PYBIN in {9..10}; do "python3.${PYBIN}" -m pip wheel . -w wheelhouse/ --verbose; done
328+
329+
- name: Auditing wheels
330+
run: delocate-wheel -v -w wheelhouse/audited wheelhouse/*.whl
331+
332+
- name: Archive wheel artifacts
333+
uses: actions/upload-artifact@v2
334+
with:
335+
name: audited-wheels
336+
path: wheelhouse/audited/
337+
- name: Deploy wheels to artifactory (if not a release)
338+
if: startsWith(github.ref, 'refs/tags/v') != true
339+
run: bash ./ci/upload-artifactory.sh
340+
env:
341+
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }}
342+
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
343+
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}
344+
284345
# This job builds wheels for x86_64 arch
285346
build-linux-x86_64:
286347
needs: build-docstrings
@@ -404,7 +465,7 @@ jobs:
404465

405466
release:
406467
if: startsWith(github.ref, 'refs/tags/v')
407-
needs: [pytest, build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64, build-linux-arm64]
468+
needs: [pytest, build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-macos-arm64, build-linux-x86_64, build-linux-arm64]
408469
runs-on: ubuntu-latest
409470

410471
steps:
@@ -462,3 +523,17 @@ jobs:
462523
PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
463524
PYPI_USER: ${{ secrets.PYPI_USER }}
464525
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
526+
527+
notify_robothub:
528+
if: startsWith(github.ref, 'refs/tags/v')
529+
needs: [release]
530+
runs-on: ubuntu-latest
531+
steps:
532+
- name: Repository Dispatch
533+
uses: peter-evans/repository-dispatch@v2
534+
with:
535+
token: ${{ secrets.REPO_ACCESS_TOKEN }}
536+
repository: luxonis/robothub-apps
537+
event-type: depthai-python-release
538+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
539+

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,15 @@ _builds/
3232

3333
#ci
3434
wheelhouse/
35+
36+
# Environments
37+
.env
38+
.venv
39+
env/
40+
venv/
41+
ENV/
42+
env.bak/
43+
venv.bak/
44+
45+
# PyCharm
46+
.idea/

CMakeLists.txt

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ if(NOT WIN32)
99
set(HUNTER_CONFIGURATION_TYPES "Release" CACHE STRING "Hunter dependencies list of build configurations")
1010
endif()
1111

12+
# Specify path separator
13+
set(SYS_PATH_SEPARATOR ";")
14+
if(UNIX)
15+
set(SYS_PATH_SEPARATOR ":")
16+
endif()
17+
1218
# Generate combined Hunter config
1319
file(READ depthai-core/cmake/Hunter/config.cmake depthai_core_hunter_config)
1420
file(READ cmake/Hunter/config.cmake hunter_config)
@@ -17,8 +23,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated/Hunter/config.cmake ${final_hun
1723

1824
include("cmake/HunterGate.cmake")
1925
HunterGate(
20-
URL "https://github.com/cpp-pm/hunter/archive/v0.23.320.tar.gz"
21-
SHA1 "9b4e732afd22f40482c11ad6342f7d336634226f"
26+
URL "https://github.com/cpp-pm/hunter/archive/v0.23.322.tar.gz"
27+
SHA1 "cb0ea1f74f4a2c49a807de34885743495fccccbe"
2228
FILEPATH ${CMAKE_CURRENT_BINARY_DIR}/generated/Hunter/config.cmake # Combined config
2329
)
2430

@@ -29,7 +35,7 @@ endif()
2935

3036
# Pybindings project
3137
set(TARGET_NAME depthai)
32-
project(depthai VERSION "0") # revision of bindings [depthai-core].[rev]
38+
project(depthai VERSION "1") # revision of bindings [depthai-core].[rev]
3339

3440
# Set default build type depending on context
3541
set(default_build_type "Release")
@@ -90,13 +96,74 @@ pybind11_add_module(${TARGET_NAME}
9096
src/DatatypeBindings.cpp
9197
src/DataQueueBindings.cpp
9298
src/pipeline/PipelineBindings.cpp
93-
src/pipeline/NodeBindings.cpp
9499
src/pipeline/CommonBindings.cpp
95100
src/pipeline/AssetManagerBindings.cpp
96101
src/openvino/OpenVINOBindings.cpp
97102
src/log/LogBindings.cpp
103+
104+
src/pipeline/node/NodeBindings.cpp
105+
106+
src/pipeline/node/XLinkInBindings.cpp
107+
src/pipeline/node/XLinkOutBindings.cpp
108+
src/pipeline/node/ColorCameraBindings.cpp
109+
src/pipeline/node/MonoCameraBindings.cpp
110+
src/pipeline/node/StereoDepthBindings.cpp
111+
src/pipeline/node/NeuralNetworkBindings.cpp
112+
src/pipeline/node/VideoEncoderBindings.cpp
113+
src/pipeline/node/ImageManipBindings.cpp
114+
src/pipeline/node/SPIOutBindings.cpp
115+
src/pipeline/node/SPIInBindings.cpp
116+
src/pipeline/node/DetectionNetworkBindings.cpp
117+
src/pipeline/node/SystemLoggerBindings.cpp
118+
src/pipeline/node/ScriptBindings.cpp
119+
src/pipeline/node/SpatialLocationCalculatorBindings.cpp
120+
src/pipeline/node/SpatialDetectionNetworkBindings.cpp
121+
src/pipeline/node/ObjectTrackerBindings.cpp
122+
src/pipeline/node/IMUBindings.cpp
123+
src/pipeline/node/EdgeDetectorBindings.cpp
124+
src/pipeline/node/FeatureTrackerBindings.cpp
125+
src/pipeline/node/AprilTagBindings.cpp
126+
src/pipeline/node/DetectionParserBindings.cpp
127+
128+
src/pipeline/datatype/ADatatypeBindings.cpp
129+
src/pipeline/datatype/AprilTagConfigBindings.cpp
130+
src/pipeline/datatype/AprilTagsBindings.cpp
131+
src/pipeline/datatype/BufferBindings.cpp
132+
src/pipeline/datatype/CameraControlBindings.cpp
133+
src/pipeline/datatype/EdgeDetectorConfigBindings.cpp
134+
src/pipeline/datatype/FeatureTrackerConfigBindings.cpp
135+
src/pipeline/datatype/ImageManipConfigBindings.cpp
136+
src/pipeline/datatype/ImgDetectionsBindings.cpp
137+
src/pipeline/datatype/ImgFrameBindings.cpp
138+
src/pipeline/datatype/IMUDataBindings.cpp
139+
src/pipeline/datatype/NNDataBindings.cpp
140+
src/pipeline/datatype/SpatialImgDetectionsBindings.cpp
141+
src/pipeline/datatype/SpatialLocationCalculatorConfigBindings.cpp
142+
src/pipeline/datatype/SpatialLocationCalculatorDataBindings.cpp
143+
src/pipeline/datatype/StereoDepthConfigBindings.cpp
144+
src/pipeline/datatype/SystemInformationBindings.cpp
145+
src/pipeline/datatype/TrackedFeaturesBindings.cpp
146+
src/pipeline/datatype/TrackletsBindings.cpp
147+
98148
)
99149

150+
if(WIN32)
151+
# Copy dlls to target directory - Windows only
152+
# TARGET_RUNTIME_DLLS generator expression available since CMake 3.21
153+
if(CMAKE_VERSION VERSION_LESS "3.21")
154+
file(GLOB depthai_dll_libraries "${HUNTER_INSTALL_PREFIX}/bin/*.dll")
155+
else()
156+
set(depthai_dll_libraries "$<TARGET_RUNTIME_DLLS:${TARGET_NAME}>")
157+
endif()
158+
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND
159+
${CMAKE_COMMAND} -E copy ${depthai_dll_libraries} $<TARGET_FILE_DIR:${TARGET_NAME}>
160+
COMMAND_EXPAND_LISTS
161+
)
162+
163+
# Disable "d" postfix, so python can import the library as is
164+
set_target_properties(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX "")
165+
endif()
166+
100167
# Add stubs (pyi) generation step after building bindings
101168
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "from mypy import api" RESULT_VARIABLE error OUTPUT_QUIET ERROR_QUIET)
102169
if(error)
@@ -108,7 +175,10 @@ else()
108175
endif()
109176
message(STATUS "Mypy available, creating and checking stubs. Running with generate_stubs.py ${TARGET_NAME} ${bindings_directory}")
110177
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND
111-
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/generate_stubs.py" "${TARGET_NAME}" "${bindings_directory}"
178+
${CMAKE_COMMAND} -E env
179+
# Python path (to find compiled module)
180+
"PYTHONPATH=$<TARGET_FILE_DIR:${TARGET_NAME}>${SYS_PATH_SEPARATOR}$ENV{PYTHONPATH}"
181+
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/generate_stubs.py" "${TARGET_NAME}" "$<TARGET_FILE_DIR:${TARGET_NAME}>"
112182
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/generate_stubs.py"
113183
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
114184
)

ci/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ RUN apt-get update && apt-get install -y wget build-essential cmake pkg-config l
44

55
ADD ci/docker_dependencies.sh .
66
RUN ./docker_dependencies.sh
7-
RUN wget https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.tar.bz2
8-
RUN tar xf libusb-1.0.24.tar.bz2
9-
RUN cd libusb-1.0.24 && \
10-
./configure --disable-udev && \
11-
make -j && make install
12-
137

148
RUN pip install -U pip && pip install --extra-index-url https://www.piwheels.org/simple/ --prefer-binary opencv-python
159

cmake/Hunter/config.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# Pybind11 2.7.0
1+
# Pybind11 2.9.2
22
hunter_config(
33
pybind11
4-
VERSION "2.7.0"
4+
VERSION "2.9.2"
5+
URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.9.2.tar.gz"
6+
SHA1 "5e05583a210282c3251281b6ee5677915f0cbf95"
57
)

depthai-core

Submodule depthai-core updated 109 files

docs/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ else()
4040
add_custom_target(sphinx ALL
4141
${CMAKE_COMMAND} -E env
4242
# Environment variables
43+
# PATH (dlls)
44+
"PATH=${HUNTER_INSTALL_PREFIX}/bin${SYS_PATH_SEPARATOR}$ENV{PATH}"
4345
# Python path (to find compiled module)
4446
"PYTHONPATH=$<TARGET_FILE_DIR:${TARGET_NAME}>${SYS_PATH_SEPARATOR}$ENV{PYTHONPATH}"
4547
# ASAN in case of sanitizers

docs/ci.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ execute_process(COMMAND ${CMAKE_COMMAND}
1616
)
1717

1818
# Build
19-
execute_process(COMMAND ${CMAKE_COMMAND} --build build --parallel 3 WORKING_DIRECTORY ${project_root} COMMAND_ECHO STDOUT)
19+
execute_process(COMMAND ${CMAKE_COMMAND} --build build --parallel 2 WORKING_DIRECTORY ${project_root} COMMAND_ECHO STDOUT)

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ Sphinx-Substitution-Extensions==2020.9.30.0
77
sphinx-autopackagesummary==1.3
88
autodocsumm==0.2.2
99
pathlib==1.0.1
10+
jinja2==3.0.3
1011
-r ./requirements_mkdoc.txt

0 commit comments

Comments
 (0)