Skip to content

Commit ad4ddea

Browse files
authored
Merge pull request #1023 from luxonis/release_2.26.0.0
Release 2.26.0.0
2 parents e0726e1 + 307a650 commit ad4ddea

25 files changed

+1297
-129
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 62 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
@@ -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:

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ pybind11_add_module(${TARGET_NAME}
132132
src/pipeline/node/PointCloudBindings.cpp
133133
src/pipeline/node/SyncBindings.cpp
134134
src/pipeline/node/MessageDemuxBindings.cpp
135-
135+
src/pipeline/node/CastBindings.cpp
136+
src/pipeline/node/ImageAlignBindings.cpp
136137
src/pipeline/datatype/ADatatypeBindings.cpp
137138
src/pipeline/datatype/AprilTagConfigBindings.cpp
138139
src/pipeline/datatype/AprilTagsBindings.cpp
@@ -157,6 +158,7 @@ pybind11_add_module(${TARGET_NAME}
157158
src/pipeline/datatype/TrackletsBindings.cpp
158159
src/pipeline/datatype/PointCloudConfigBindings.cpp
159160
src/pipeline/datatype/PointCloudDataBindings.cpp
161+
src/pipeline/datatype/ImageAlignConfigBindings.cpp
160162
)
161163

162164
if(WIN32)

depthai-core

examples/Camera/thermal_cam.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def onMouse(event, x, y, *args):
1616

1717
# Thermal camera
1818
thermalCam = pipeline.create(dai.node.Camera)
19+
thermalCam.setFps(25) # Limit to 25 to match what the sensor can do, capped even if left at default, but warns.
1920
width, height = -1, -1
2021
thermalFound = False
2122
for features in device.getConnectedCameraFeatures():

examples/Cast/blur.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import depthai as dai
2+
import cv2
3+
from pathlib import Path
4+
5+
SHAPE = 300
6+
7+
p = dai.Pipeline()
8+
9+
camRgb = p.create(dai.node.ColorCamera)
10+
nn = p.create(dai.node.NeuralNetwork)
11+
rgbOut = p.create(dai.node.XLinkOut)
12+
cast = p.create(dai.node.Cast)
13+
castXout = p.create(dai.node.XLinkOut)
14+
15+
camRgb.setPreviewSize(SHAPE, SHAPE)
16+
camRgb.setInterleaved(False)
17+
18+
nnBlobPath = (Path(__file__).parent / Path('../models/blur_simplified_openvino_2021.4_6shave.blob')).resolve().absolute()
19+
20+
nn.setBlobPath(nnBlobPath)
21+
22+
rgbOut.setStreamName("rgb")
23+
24+
castXout.setStreamName("cast")
25+
26+
cast.setOutputFrameType(dai.RawImgFrame.Type.BGR888p)
27+
28+
# Linking
29+
camRgb.preview.link(nn.input)
30+
camRgb.preview.link(rgbOut.input)
31+
nn.out.link(cast.input)
32+
cast.output.link(castXout.input)
33+
34+
with dai.Device(p) as device:
35+
qCam = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
36+
qCast = device.getOutputQueue(name="cast", maxSize=4, blocking=False)
37+
38+
39+
while True:
40+
inCast = qCast.get()
41+
assert isinstance(inCast, dai.ImgFrame)
42+
inRgb = qCam.get()
43+
assert isinstance(inRgb, dai.ImgFrame)
44+
cv2.imshow("Blur", inCast.getCvFrame())
45+
cv2.imshow("Original", inRgb.getCvFrame())
46+
47+
48+
if cv2.waitKey(1) == ord('q'):
49+
break

examples/Cast/concat.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import numpy as np
2+
import cv2
3+
import depthai as dai
4+
from pathlib import Path
5+
6+
SHAPE = 300
7+
8+
p = dai.Pipeline()
9+
10+
camRgb = p.create(dai.node.ColorCamera)
11+
left = p.create(dai.node.MonoCamera)
12+
right = p.create(dai.node.MonoCamera)
13+
manipLeft = p.create(dai.node.ImageManip)
14+
manipRight = p.create(dai.node.ImageManip)
15+
nn = p.create(dai.node.NeuralNetwork)
16+
cast = p.create(dai.node.Cast)
17+
castXout = p.create(dai.node.XLinkOut)
18+
19+
camRgb.setPreviewSize(SHAPE, SHAPE)
20+
camRgb.setInterleaved(False)
21+
camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
22+
23+
left.setCamera("left")
24+
left.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
25+
manipLeft.initialConfig.setResize(SHAPE, SHAPE)
26+
manipLeft.initialConfig.setFrameType(dai.ImgFrame.Type.BGR888p)
27+
28+
right.setCamera("right")
29+
right.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
30+
manipRight.initialConfig.setResize(SHAPE, SHAPE)
31+
manipRight.initialConfig.setFrameType(dai.ImgFrame.Type.BGR888p)
32+
33+
nnBlobPath = (Path(__file__).parent / Path('../models/concat_openvino_2021.4_6shave.blob')).resolve().absolute()
34+
nn.setBlobPath(nnBlobPath)
35+
nn.setNumInferenceThreads(2)
36+
37+
castXout.setStreamName("cast")
38+
cast.setOutputFrameType(dai.ImgFrame.Type.BGR888p)
39+
40+
# Linking
41+
left.out.link(manipLeft.inputImage)
42+
right.out.link(manipRight.inputImage)
43+
manipLeft.out.link(nn.inputs['img1'])
44+
camRgb.preview.link(nn.inputs['img2'])
45+
manipRight.out.link(nn.inputs['img3'])
46+
nn.out.link(cast.input)
47+
cast.output.link(castXout.input)
48+
49+
# Pipeline is defined, now we can connect to the device
50+
with dai.Device(p) as device:
51+
qCast = device.getOutputQueue(name="cast", maxSize=4, blocking=False)
52+
53+
while True:
54+
inCast = qCast.get()
55+
assert isinstance(inCast, dai.ImgFrame)
56+
cv2.imshow("Concated frames", inCast.getCvFrame())
57+
58+
if cv2.waitKey(1) == ord('q'):
59+
break

examples/Cast/diff.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import cv2
2+
import depthai as dai
3+
from pathlib import Path
4+
5+
SHAPE = 720
6+
7+
p = dai.Pipeline()
8+
9+
camRgb = p.create(dai.node.ColorCamera)
10+
nn = p.create(dai.node.NeuralNetwork)
11+
script = p.create(dai.node.Script)
12+
rgbXout = p.create(dai.node.XLinkOut)
13+
cast = p.create(dai.node.Cast)
14+
castXout = p.create(dai.node.XLinkOut)
15+
16+
camRgb.setVideoSize(SHAPE, SHAPE)
17+
camRgb.setPreviewSize(SHAPE, SHAPE)
18+
camRgb.setInterleaved(False)
19+
20+
nnBlobPath = (Path(__file__).parent / Path('../models/diff_openvino_2022.1_6shave.blob')).resolve().absolute()
21+
nn.setBlobPath(nnBlobPath)
22+
23+
script.setScript("""
24+
old = node.io['in'].get()
25+
while True:
26+
frame = node.io['in'].get()
27+
node.io['img1'].send(old)
28+
node.io['img2'].send(frame)
29+
old = frame
30+
""")
31+
32+
rgbXout.setStreamName("rgb")
33+
castXout.setStreamName("cast")
34+
cast.setOutputFrameType(dai.RawImgFrame.Type.GRAY8)
35+
36+
# Linking
37+
camRgb.preview.link(script.inputs['in'])
38+
script.outputs['img1'].link(nn.inputs['img1'])
39+
script.outputs['img2'].link(nn.inputs['img2'])
40+
camRgb.video.link(rgbXout.input)
41+
nn.out.link(cast.input)
42+
cast.output.link(castXout.input)
43+
44+
# Pipeline is defined, now we can connect to the device
45+
with dai.Device(p) as device:
46+
qCam = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
47+
qCast = device.getOutputQueue(name="cast", maxSize=4, blocking=False)
48+
49+
50+
while True:
51+
colorFrame = qCam.get()
52+
assert isinstance(colorFrame, dai.ImgFrame)
53+
cv2.imshow("Color", colorFrame.getCvFrame())
54+
55+
inCast = qCast.get()
56+
assert isinstance(inCast, dai.ImgFrame)
57+
cv2.imshow("Diff", inCast.getCvFrame())
58+
59+
if cv2.waitKey(1) == ord('q'):
60+
break

0 commit comments

Comments
 (0)