Skip to content

Commit cc91732

Browse files
author
Matevz Morato
committed
Merge branch 'update_examples' into feat/stubs-docstring-generation
2 parents 8fdc9ec + 62dce68 commit cc91732

File tree

80 files changed

+4801
-441
lines changed

Some content is hidden

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

80 files changed

+4801
-441
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ jobs:
7272
steps:
7373
- name: Print home directory
7474
run: echo Home directory inside container $HOME
75-
75+
- name: Setup cmake
76+
if: matrix.os == 'macos-latest'
77+
uses: jwlawson/[email protected]
7678
- name: Cache .hunter folder
7779
if: matrix.os != 'windows-latest'
7880
uses: actions/cache@v3
@@ -132,7 +134,7 @@ jobs:
132134
needs: build-docstrings
133135
strategy:
134136
matrix:
135-
rpi-os: [rpi-buster, rpi-bullseye]
137+
rpi-os: [rpi-buster, rpi-bullseye, rpi-bookworm]
136138
runs-on: ${{ matrix.rpi-os }}
137139
steps:
138140
- name: Print home directory
@@ -155,7 +157,7 @@ jobs:
155157
run: python3 -m pip wheel . -w ./wheelhouse/ --verbose
156158
- name: Auditing wheels and adding armv6l tag (Running on RPi, binaries compiled as armv6l)
157159
run: |
158-
python3 -m pip install -U wheel auditwheel
160+
# python3 -m pip install -U wheel auditwheel # Called once when setting up the runner
159161
for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat linux_armv7l -w wheelhouse/preaudited/; done
160162
for whl in wheelhouse/preaudited/*.whl; do python3 -m wheel tags --platform-tag +linux_armv6l "$whl"; done
161163
mkdir -p wheelhouse/audited/
@@ -230,13 +232,13 @@ jobs:
230232
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}
231233

232234
# This job builds wheels for macOS x86_64 arch
233-
build-macos-x86_64:
235+
build-macos:
234236
needs: build-docstrings
235237
runs-on: macos-latest
236238
strategy:
237239
matrix:
238-
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
239-
fail-fast: false
240+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
241+
os: [macos-13, macos-14] # macos-13 is x64, macos-14 is arm64
240242
steps:
241243
- name: Cache .hunter folder
242244
uses: actions/cache@v3
@@ -290,63 +292,6 @@ jobs:
290292
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
291293
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}
292294

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

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

476421
steps:
@@ -531,18 +476,6 @@ jobs:
531476
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
532477
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}
533478

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

547480
# notify_hil_workflow_linux_x86_64:
548481
# needs: [build-linux-x86_64]
@@ -556,8 +489,8 @@ jobs:
556489
# event-type: python-hil-event
557490
# client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
558491

559-
notify_hil_workflow_linux_x86_64:
560-
needs: [build-linux-x86_64]
492+
notify_hil_workflow:
493+
needs: [build-linux-armhf, build-linux-x86_64]
561494
runs-on: ubuntu-latest
562495
steps:
563496
- name: Dispatch an action and get the run ID

.github/workflows/test-install-dependencies.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
container_image: ["fedora:34", "fedora:35", "fedora:36", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"]
19+
container_image: ["fedora:34", "fedora:35", "fedora:36", "ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:rolling"]
2020
container:
2121
image: ${{ matrix.container_image }}
2222
steps:
@@ -32,7 +32,17 @@
3232
ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone # Otherwise tzdata installer prompts for user input
3333
sed '/udevadm control --reload-rules && sudo udevadm trigger/d' docs/source/_static/install_dependencies.sh > tmp_script.sh # Doesn't work on docker
3434
bash tmp_script.sh
35+
- name: Create a virtual environment
36+
if: endsWith(matrix.container_image, 'rolling') == true
37+
run: |
38+
sudo apt-get install -y python3-venv
39+
python3 -m venv .env
40+
. .env/bin/activate
41+
pip install --upgrade pip
42+
python3 examples/install_requirements.py
43+
shell: bash
3544
- name: Install example requirements
45+
if: endsWith(matrix.container_image, 'rolling') == false
3646
run: |
3747
python3 examples/install_requirements.py
3848
test_macos:
@@ -46,9 +56,13 @@
4656
run: |
4757
sed '/udevadm control --reload-rules && sudo udevadm trigger/d' docs/source/_static/install_dependencies.sh > tmp_script.sh
4858
bash tmp_script.sh
49-
- name: Install example requirements
59+
- name: Create a virtual environment
5060
run: |
61+
python3 -m venv .env
62+
. .env/bin/activate
63+
pip install --upgrade pip
5164
python3 examples/install_requirements.py
65+
shell: bash
5266
test_windows:
5367
runs-on: windows-latest
5468
steps:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ depthai-core/build/
2222

2323
# builds
2424
_builds/
25-
25+
.cache/
2626
#git
2727
*.orig
2828
*_REMOTE_*
@@ -44,4 +44,4 @@ env.bak/
4444
venv.bak/
4545

4646
# PyCharm
47-
.idea/
47+
.idea/

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,11 @@ pybind11_add_module(${TARGET_NAME}
129129
src/pipeline/node/WarpBindings.cpp
130130
src/pipeline/node/UVCBindings.cpp
131131
src/pipeline/node/ToFBindings.cpp
132+
src/pipeline/node/PointCloudBindings.cpp
132133
src/pipeline/node/SyncBindings.cpp
133134
src/pipeline/node/MessageDemuxBindings.cpp
134-
135+
src/pipeline/node/CastBindings.cpp
136+
src/pipeline/node/ImageAlignBindings.cpp
135137
src/pipeline/datatype/ADatatypeBindings.cpp
136138
src/pipeline/datatype/AprilTagConfigBindings.cpp
137139
src/pipeline/datatype/AprilTagsBindings.cpp
@@ -154,7 +156,9 @@ pybind11_add_module(${TARGET_NAME}
154156
src/pipeline/datatype/SystemInformationBindings.cpp
155157
src/pipeline/datatype/TrackedFeaturesBindings.cpp
156158
src/pipeline/datatype/TrackletsBindings.cpp
157-
159+
src/pipeline/datatype/PointCloudConfigBindings.cpp
160+
src/pipeline/datatype/PointCloudDataBindings.cpp
161+
src/pipeline/datatype/ImageAlignConfigBindings.cpp
158162
)
159163

160164
if(WIN32)

depthai-core

Submodule depthai-core updated 55 files

depthai_cli/__init__.py

Whitespace-only changes.

depthai_cli/depthai_cli.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import os
2+
from pathlib import Path
3+
import subprocess
4+
5+
here = os.path.dirname(os.path.realpath(__file__))
6+
7+
if os.path.exists(os.path.join(here, "cam_test.py")): # Installed package
8+
CAM_TEST_PATH = Path(here) / "cam_test.py"
9+
else:
10+
CAM_TEST_PATH = (
11+
Path(here) / ".." / "utilities" / "cam_test.py"
12+
) # Execution from source
13+
CAM_TEST_PATH = str(CAM_TEST_PATH)
14+
15+
16+
def cli() -> int:
17+
import argparse
18+
import sys
19+
import depthai as dai
20+
parser = argparse.ArgumentParser(description="DepthAI CLI", add_help=True)
21+
parser.add_argument("-v", "--version", action="store_true", help="Print version and exit.")
22+
parser.add_argument("-l", "--list-devices", action="store_true", help="List connected devices.")
23+
subparsers = parser.add_subparsers(dest="command", help="Sub-commands")
24+
# Define the parser for the "cam_test" command
25+
cam_test_parser = subparsers.add_parser("cam_test", help="Commands and options for cam_test", add_help=False)
26+
cam_test_parser.add_argument("args", nargs=argparse.REMAINDER, help="Arguments to pass to cam_test")
27+
28+
# subparser REMINDER args would get parsed too if we used parse_args, so we have to handle unknown args manually
29+
args, unknown_args = parser.parse_known_args()
30+
if args.command == "cam_test":
31+
cam_test_path = CAM_TEST_PATH
32+
return subprocess.run([sys.executable, cam_test_path] + cam_test_parser.parse_args().args[1:]).returncode
33+
# Parse other subcommands here
34+
elif unknown_args:
35+
parser.error(f"Unrecognized arguments: {unknown_args}") # handles exit internally
36+
elif args.version:
37+
print(dai.__version__)
38+
return 0
39+
elif args.list_devices:
40+
print(dai.Device.getAllConnectedDevices())
41+
return 0
42+
else:
43+
# No recognized commands, print help
44+
parser.print_help()
45+
return 1
46+
47+
48+
if __name__ == "__main__":
49+
exit(cli())
12.1 KB
Loading
104 KB
Loading
416 KB
Loading

0 commit comments

Comments
 (0)