Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
SzabolcsGergely committed Oct 11, 2024
2 parents a2e7f59 + d3b92a9 commit 5ebca7c
Show file tree
Hide file tree
Showing 125 changed files with 5,976 additions and 787 deletions.
125 changes: 37 additions & 88 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ jobs:
steps:
- name: Print home directory
run: echo Home directory inside container $HOME

- name: Setup cmake
if: matrix.os == 'macos-latest'
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.29.x'
- name: Cache .hunter folder
if: matrix.os != 'windows-latest'
uses: actions/cache@v3
Expand Down Expand Up @@ -132,8 +136,12 @@ jobs:
needs: build-docstrings
strategy:
matrix:
rpi-os: [rpi-buster, rpi-bullseye]
rpi-os: [rpi-buster, rpi-bullseye, rpi-bookworm]
runs-on: ${{ matrix.rpi-os }}
env:
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
# to be removed when upgrading the manylinux image
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Print home directory
run: echo Home directory inside container $HOME
Expand All @@ -152,10 +160,10 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v') != true
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
- name: Building wheel
run: python3 -m pip wheel . -w ./wheelhouse/ --verbose
run: CMAKE_ARGS='-DDEPTHAI_ENABLE_CURL=OFF' python3 -m pip wheel . -w ./wheelhouse/ --verbose
- name: Auditing wheels and adding armv6l tag (Running on RPi, binaries compiled as armv6l)
run: |
python3 -m pip install -U wheel auditwheel
# python3 -m pip install -U wheel auditwheel # Called once when setting up the runner
for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat linux_armv7l -w wheelhouse/preaudited/; done
for whl in wheelhouse/preaudited/*.whl; do python3 -m wheel tags --platform-tag +linux_armv6l "$whl"; done
mkdir -p wheelhouse/audited/
Expand All @@ -180,7 +188,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
python-architecture: [x64, x86]
fail-fast: false
steps:
Expand All @@ -203,6 +211,8 @@ jobs:
- name: Select Windows SDK
run: echo "CMAKE_ARGS=-DCMAKE_SYSTEM_VERSION=${{ env.CMAKE_WINDOWS_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Install dependencies
run: choco install strawberryperl
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -230,13 +240,13 @@ jobs:
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}

# This job builds wheels for macOS x86_64 arch
build-macos-x86_64:
build-macos:
needs: build-docstrings
runs-on: macos-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
fail-fast: false
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
os: [macos-13, macos-14] # macos-13 is x64, macos-14 is arm64
runs-on: ${{ matrix.os }}
steps:
- name: Cache .hunter folder
uses: actions/cache@v3
Expand Down Expand Up @@ -290,69 +300,16 @@ jobs:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}

# This job builds wheels for macOS arm64 arch
build-macos-arm64:
needs: build-docstrings
runs-on: [self-hosted, macOS, ARM64]
steps:
# Cached locally on runner
# - name: Cache .hunter folder
# uses: actions/cache@v3
# with:
# path: ~/.hunter
# key: hunter-macos-latest
- name: List .hunter cache directory
run: |
ls -a -l ~/.hunter/_Base/ || true
echo "PATH=$PATH"
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- uses: actions/download-artifact@v3
with:
name: 'docstrings'
path: docstrings
- name: Specify docstring to use while building the wheel
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV

- name: Append build hash if not a tagged commit
if: startsWith(github.ref, 'refs/tags/v') != true
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV

# - name: Build and install depthai-core
# run: |
# echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV
# cmake -S depthai-core/ -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
# cmake --build build_core --target install --parallel 4
# echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV

- name: Build wheels
run: for PYBIN in {9..11}; do "python3.${PYBIN}" -m pip wheel . -w wheelhouse/ --verbose; done

- name: Auditing wheels
run: delocate-wheel -v -w wheelhouse/audited wheelhouse/*.whl

- name: Archive wheel artifacts
uses: actions/upload-artifact@v3
with:
name: audited-wheels
path: wheelhouse/audited/
- name: Deploy wheels to artifactory (if not a release)
if: startsWith(github.ref, 'refs/tags/v') != true
run: bash ./ci/upload-artifactory.sh
env:
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}

# This job builds wheels for x86_64 arch
build-linux-x86_64:
needs: build-docstrings
runs-on: ubuntu-latest
env:
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
# to be removed when upgrading the manylinux image
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container:
image: quay.io/pypa/manylinux2014_x86_64:2022-10-30-402504a
image: quay.io/pypa/manylinux2014_x86_64:latest
env:
PLAT: manylinux2014_x86_64
steps:
Expand All @@ -365,7 +322,7 @@ jobs:
with:
submodules: 'recursive'
- name: Installing libusb1-devel dependency
run: yum install -y --disableplugin=fastestmirror libusb1-devel
run: yum install -y --disableplugin=fastestmirror libusb1-devel perl-core
- name: Installing cmake dependency
run: |
/opt/python/cp38-cp38/bin/python3.8 -m pip install cmake
Expand Down Expand Up @@ -395,7 +352,7 @@ jobs:
/opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar
mv dist/* wheelhouse/audited/
- name: Build wheels
run: for PYBIN in /opt/python/cp3{6..11}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
run: for PYBIN in /opt/python/cp3{7..12}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
- name: Audit wheels
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
- name: Archive wheel artifacts
Expand All @@ -415,8 +372,12 @@ jobs:
build-linux-arm64:
needs: build-docstrings
runs-on: [self-hosted, linux, ARM64]
env:
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
# to be removed when upgrading the manylinux image
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container:
image: quay.io/pypa/manylinux2014_aarch64:2022-10-30-402504a
image: quay.io/pypa/manylinux2014_aarch64:latest
env:
PLAT: manylinux2014_aarch64
# Mount local hunter cache directory, instead of transfering to Github and back
Expand All @@ -427,7 +388,7 @@ jobs:
with:
submodules: 'recursive'
- name: Installing libusb1-devel dependency
run: yum install -y --disableplugin=fastestmirror libusb1-devel
run: yum install -y --disableplugin=fastestmirror libusb1-devel perl-core
- name: Installing cmake dependency
run: |
/opt/python/cp38-cp38/bin/python3.8 -m pip install cmake
Expand All @@ -452,7 +413,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v') != true
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
- name: Building wheels
run: for PYBIN in /opt/python/cp3{6..11}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
run: for PYBIN in /opt/python/cp3{7..12}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
- name: Auditing wheels
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
- name: Archive wheel artifacts
Expand All @@ -470,7 +431,7 @@ jobs:

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

steps:
Expand Down Expand Up @@ -531,18 +492,6 @@ jobs:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}

notify_robothub:
if: startsWith(github.ref, 'refs/tags/v')
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: luxonis/robothub-apps
event-type: depthai-python-release
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

# notify_hil_workflow_linux_x86_64:
# needs: [build-linux-x86_64]
Expand All @@ -556,8 +505,8 @@ jobs:
# event-type: python-hil-event
# client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

notify_hil_workflow_linux_x86_64:
needs: [build-linux-x86_64]
notify_hil_workflow:
needs: [build-linux-armhf, build-linux-x86_64]
runs-on: ubuntu-latest
steps:
- name: Dispatch an action and get the run ID
Expand All @@ -573,4 +522,4 @@ jobs:
workflow_timeout_seconds: 300 # was 120 Default: 300

- name: Release
run: echo "https://github.com/luxonis/depthai-core-hil-tests/actions/runs/${{steps.return_dispatch.outputs.run_id}}" >> $GITHUB_STEP_SUMMARY
run: echo "https://github.com/luxonis/depthai-core-hil-tests/actions/runs/${{steps.return_dispatch.outputs.run_id}}" >> $GITHUB_STEP_SUMMARY
30 changes: 24 additions & 6 deletions .github/workflows/test-install-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
runs-on: ubuntu-latest
strategy:
matrix:
container_image: ["fedora:34", "fedora:35", "fedora:36", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:22.10"]
container_image: ["fedora:34", "fedora:35", "fedora:36", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "ubuntu:rolling"]
container:
image: ${{ matrix.container_image }}
steps:
Expand All @@ -32,33 +32,51 @@
ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone # Otherwise tzdata installer prompts for user input
sed '/udevadm control --reload-rules && sudo udevadm trigger/d' docs/source/_static/install_dependencies.sh > tmp_script.sh # Doesn't work on docker
bash tmp_script.sh
- name: Create a virtual environment
if: endsWith(matrix.container_image, 'rolling') == true
run: |
sudo apt-get install -y python3-venv
python3 -m venv .env
. .env/bin/activate
pip install --upgrade pip
python3 examples/install_requirements.py
shell: bash
- name: Install example requirements
if: endsWith(matrix.container_image, 'rolling') == false
run: |
python3 examples/install_requirements.py
test_macos:
strategy:
matrix:
os: ["macos-11", "macos-12"]
os: ["macos-12", "macos-13", "macos-14"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sed '/udevadm control --reload-rules && sudo udevadm trigger/d' docs/source/_static/install_dependencies.sh > tmp_script.sh
bash tmp_script.sh
- name: Install example requirements
- name: Create a virtual environment
run: |
python3 -m venv .env
. .env/bin/activate
pip install --upgrade pip
python3 examples/install_requirements.py
shell: bash
test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Download chocolatey
shell: pwsh
run: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- name: Install dependencies
- name: Install pycharm-community dependency
shell: pwsh
run: choco install cmake git python --version 3.10 -y
- name: Install example requrirements
run: choco install pycharm-community -y
- name: Install example requirements
run: |
python examples/install_requirements.py
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ depthai-core/build/

# builds
_builds/

.cache/
#git
*.orig
*_REMOTE_*
Expand All @@ -44,4 +44,4 @@ env.bak/
venv.bak/

# PyCharm
.idea/
.idea/
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated/Hunter/config.cmake ${final_hun

include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.322.tar.gz"
SHA1 "cb0ea1f74f4a2c49a807de34885743495fccccbe"
URL "https://github.com/cpp-pm/hunter/archive/9d9242b60d5236269f894efd3ddd60a9ca83dd7f.tar.gz"
SHA1 "16cc954aa723bccd16ea45fc91a858d0c5246376"
FILEPATH ${CMAKE_CURRENT_BINARY_DIR}/generated/Hunter/config.cmake # Combined config
)

Expand Down Expand Up @@ -129,9 +129,11 @@ pybind11_add_module(${TARGET_NAME}
src/pipeline/node/WarpBindings.cpp
src/pipeline/node/UVCBindings.cpp
src/pipeline/node/ToFBindings.cpp
src/pipeline/node/PointCloudBindings.cpp
src/pipeline/node/SyncBindings.cpp
src/pipeline/node/MessageDemuxBindings.cpp

src/pipeline/node/CastBindings.cpp
src/pipeline/node/ImageAlignBindings.cpp
src/pipeline/datatype/ADatatypeBindings.cpp
src/pipeline/datatype/AprilTagConfigBindings.cpp
src/pipeline/datatype/AprilTagsBindings.cpp
Expand All @@ -154,7 +156,9 @@ pybind11_add_module(${TARGET_NAME}
src/pipeline/datatype/SystemInformationBindings.cpp
src/pipeline/datatype/TrackedFeaturesBindings.cpp
src/pipeline/datatype/TrackletsBindings.cpp

src/pipeline/datatype/PointCloudConfigBindings.cpp
src/pipeline/datatype/PointCloudDataBindings.cpp
src/pipeline/datatype/ImageAlignConfigBindings.cpp
)

if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![](https://img.shields.io/pypi/v/depthai.svg)](https://pypi.org/project/depthai/)
[![Python Wheel CI](https://github.com/luxonis/depthai-python/actions/workflows/main.yml/badge.svg?branch=gen2_develop)](https://github.com/luxonis/depthai-python/actions/workflows/main.yml)
[![Python Wheel CI](https://github.com/luxonis/depthai-python/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/luxonis/depthai-python/actions/workflows/main.yml)

Python bindings for C++ depthai-core library

Expand Down
8 changes: 4 additions & 4 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Pybind11 2.9.2
# Pybind11 2.12.0
hunter_config(
pybind11
VERSION "2.9.2"
URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.9.2.tar.gz"
SHA1 "5e05583a210282c3251281b6ee5677915f0cbf95"
VERSION "2.12.0"
URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.12.0.tar.gz"
SHA1 "e70610cba7b6b7d7a57827d5357c016ad2155c0f"
)
2 changes: 1 addition & 1 deletion depthai-core
Submodule depthai-core updated 78 files
+9 −2 .github/workflows/main.workflow.yml
+5 −0 .github/workflows/python-main.yml
+119 −4 CMakeLists.txt
+23 −5 README.md
+2 −2 cmake/Depthai/DepthaiBootloaderConfig.cmake
+1 −1 cmake/Depthai/DepthaiDeviceSideConfig.cmake
+36 −5 cmake/Hunter/config.cmake
+12 −0 cmake/config.hpp.in
+2 −0 cmake/depthaiConfig.cmake.in
+28 −0 cmake/depthaiDependencies.cmake
+144 −96 examples/CMakeLists.txt
+103 −0 examples/Camera/thermal_cam.cpp
+50 −0 examples/Cast/cast_blur.cpp
+63 −0 examples/Cast/cast_concat.cpp
+66 −0 examples/Cast/cast_diff.cpp
+1 −1 examples/FeatureTracker/feature_tracker.cpp
+1 −1 examples/IMU/imu_firmware_update.cpp
+148 −0 examples/ImageAlign/depth_align.cpp
+129 −0 examples/ImageAlign/image_align.cpp
+164 −0 examples/ImageAlign/thermal_align.cpp
+135 −0 examples/ImageAlign/tof_align.cpp
+90 −0 examples/PointCloud/visualize_pointcloud.cpp
+169 −0 examples/SpatialDetection/spatial_tiny_yolo_tof.cpp
+74 −0 examples/Sync/imu_video_synced.cpp
+140 −0 examples/ToF/tof_depth.cpp
+2 −2 examples/bootloader/bootloader_version.cpp
+0 −127 examples/mixed/frame_sync.cpp
+29 −1 include/depthai/common/CameraFeatures.hpp
+25 −0 include/depthai/common/StereoPair.hpp
+1 −1 include/depthai/device/CalibrationHandler.hpp
+1 −1 include/depthai/device/Device.hpp
+49 −1 include/depthai/device/DeviceBase.hpp
+11 −1 include/depthai/device/DeviceBootloader.hpp
+48 −0 include/depthai/pipeline/datatype/CameraControl.hpp
+6 −0 include/depthai/pipeline/datatype/EncodedFrame.hpp
+33 −0 include/depthai/pipeline/datatype/ImageAlignConfig.hpp
+5 −0 include/depthai/pipeline/datatype/ImgFrame.hpp
+69 −0 include/depthai/pipeline/datatype/PointCloudConfig.hpp
+205 −0 include/depthai/pipeline/datatype/PointCloudData.hpp
+0 −7 include/depthai/pipeline/datatype/ToFConfig.hpp
+3 −0 include/depthai/pipeline/datatypes.hpp
+1 −1 include/depthai/pipeline/node/Camera.hpp
+62 −0 include/depthai/pipeline/node/Cast.hpp
+1 −1 include/depthai/pipeline/node/ColorCamera.hpp
+91 −0 include/depthai/pipeline/node/ImageAlign.hpp
+1 −1 include/depthai/pipeline/node/MonoCamera.hpp
+69 −0 include/depthai/pipeline/node/PointCloud.hpp
+27 −2 include/depthai/pipeline/node/ToF.hpp
+5 −5 include/depthai/pipeline/node/VideoEncoder.hpp
+4 −0 include/depthai/pipeline/nodes.hpp
+1 −1 shared/depthai-shared
+3 −2 src/device/DataQueue.cpp
+118 −37 src/device/DeviceBase.cpp
+250 −213 src/device/DeviceBootloader.cpp
+23 −0 src/pcl/PointCloudData.cpp
+27 −0 src/pipeline/datatype/CameraControl.cpp
+3 −0 src/pipeline/datatype/EncodedFrame.cpp
+21 −0 src/pipeline/datatype/ImageAlignConfig.cpp
+6 −0 src/pipeline/datatype/ImgFrame.cpp
+47 −0 src/pipeline/datatype/PointCloudConfig.cpp
+118 −0 src/pipeline/datatype/PointCloudData.cpp
+63 −17 src/pipeline/datatype/StreamMessageParser.cpp
+1 −21 src/pipeline/datatype/ToFConfig.cpp
+34 −0 src/pipeline/node/Cast.cpp
+46 −0 src/pipeline/node/ImageAlign.cpp
+27 −0 src/pipeline/node/PointCloud.cpp
+11 −1 src/pipeline/node/ToF.cpp
+238 −0 src/utility/LogCollection.cpp
+13 −0 src/utility/LogCollection.hpp
+335 −0 src/utility/sha1.hpp
+19 −0 src/utility/spdlog-fmt.hpp
+1 −1 src/xlink/XLinkConnection.cpp
+2 −0 tests/CMakeLists.txt
+0 −1 tests/src/image_manip_node_test.cpp
+37 −0 tests/src/message_group_test.cpp
+70 −0 tests/src/pointcloud_test.cpp
+1 −3 tests/src/stability_stress_test.cpp
+24 −5 tests/src/stream_message_parser_test.cpp
Empty file added depthai_cli/__init__.py
Empty file.
Loading

0 comments on commit 5ebca7c

Please sign in to comment.