Skip to content

Commit 7dbd035

Browse files
committed
Merge branch 'release_2.20.2' into main
2 parents f60491a + b33b309 commit 7dbd035

File tree

9 files changed

+88
-26
lines changed

9 files changed

+88
-26
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -473,23 +473,17 @@ jobs:
473473
with:
474474
submodules: 'recursive'
475475

476-
# Get tag version
477-
# TODO(themarpe) - Node12, has to be updated
478-
- name: Get tag version
479-
id: tag
480-
uses: battila7/get-version-action@v2
481-
482476
- uses: actions/setup-python@v4
483477
with:
484478
python-version: '3.8'
485479

486480
- name: Check if version matches
487-
run: python3.8 -c 'import find_version as v; exit(0) if "${{ steps.tag.outputs.version-without-v }}" == v.get_package_version() else exit(1)'
481+
run: python3.8 -c 'import find_version as v; exit(0) if "${{ github.ref_name }}" == f"v{v.get_package_version()}" else exit(1)'
488482

489483
# Create GitHub release
490484
- uses: actions/create-release@master
491485
id: createRelease
492-
name: Create ${{ steps.tag.outputs.version-without-v }} depthai-core release
486+
name: Create ${{ github.ref_name }} depthai-python release
493487
env:
494488
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
495489
with:
@@ -504,8 +498,8 @@ jobs:
504498
505499
draft: true
506500

507-
# Deploy to PyPi. Only when a commit is tagged
508-
deploy-pypi:
501+
# Deploy to PyPi and Artifactory. Only when a commit is tagged
502+
deploy:
509503
if: startsWith(github.ref, 'refs/tags/v')
510504
needs: [release]
511505
runs-on: ubuntu-latest
@@ -525,6 +519,12 @@ jobs:
525519
PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
526520
PYPI_USER: ${{ secrets.PYPI_USER }}
527521
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
522+
- name: Run deploy to Artifactory
523+
run: bash ./ci/upload-artifactory-release.sh
524+
env:
525+
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }}
526+
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
527+
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }}
528528

529529
notify_robothub:
530530
if: startsWith(github.ref, 'refs/tags/v')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
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'))
5959
- name: Install dependencies
6060
shell: pwsh
61-
run: choco install cmake git python pycharm-community -y
61+
run: choco install cmake git python --version 3.10 -y
6262
- name: Install example requrirements
6363
run: |
6464
python examples/install_requirements.py

ci/upload-artifactory-release.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
curl -fL https://getcli.jfrog.io | sh
4+
5+
cd wheelhouse/audited/ || exit 1
6+
export PATH_PREFIX=luxonis-python-release-local/depthai
7+
8+
../../jfrog config add --artifactory-url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
9+
../../jfrog rt u "*" "$PATH_PREFIX/"

examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ add_python_example(rgb_camera_control ColorCamera/rgb_camera_control.py)
109109
add_python_example(rgb_preview ColorCamera/rgb_preview.py)
110110
add_python_example(rgb_scene ColorCamera/rgb_scene.py)
111111
add_python_example(rgb_video ColorCamera/rgb_video.py)
112+
add_python_example(rgb_isp_scale ColorCamera/rgb_isp_scale.py)
112113

113114
## EdgeDetector
114115
add_python_example(edge_detector EdgeDetector/edge_detector.py)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python3
2+
3+
import cv2
4+
import depthai as dai
5+
6+
# Create pipeline
7+
pipeline = dai.Pipeline()
8+
9+
# Define source and output
10+
camRgb = pipeline.create(dai.node.ColorCamera)
11+
xoutVideo = pipeline.create(dai.node.XLinkOut)
12+
13+
xoutVideo.setStreamName("video")
14+
15+
# Properties
16+
camRgb.setBoardSocket(dai.CameraBoardSocket.RGB)
17+
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_4_K)
18+
camRgb.setIspScale(1, 2)
19+
camRgb.setVideoSize(1920, 1080)
20+
21+
xoutVideo.input.setBlocking(False)
22+
xoutVideo.input.setQueueSize(1)
23+
24+
# Linking
25+
camRgb.video.link(xoutVideo.input)
26+
27+
# Connect to device and start pipeline
28+
with dai.Device(pipeline) as device:
29+
30+
video = device.getOutputQueue(name="video", maxSize=1, blocking=False)
31+
32+
while True:
33+
videoIn = video.get()
34+
35+
# Get BGR frame from NV12 encoded video frame to show with opencv
36+
# Visualizing the frame on slower hosts might have overhead
37+
cv2.imshow("video", videoIn.getCvFrame())
38+
39+
if cv2.waitKey(1) == ord('q'):
40+
break

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "mypy"] # Must be preinstalled "cmake>=3.2.0"
2+
requires = ["setuptools", "wheel", "mypy", "cmake==3.25"]

src/pipeline/CommonBindings.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "depthai-shared/common/RotatedRect.hpp"
2121
#include "depthai-shared/common/Rect.hpp"
2222
#include "depthai-shared/common/Colormap.hpp"
23+
#include "depthai-shared/common/FrameEvent.hpp"
2324

2425
// depthai
2526
#include "depthai/common/CameraFeatures.hpp"
@@ -54,6 +55,7 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
5455
py::class_<Rect> rect(m, "Rect", DOC(dai, Rect));
5556
py::enum_<CameraExposureOffset> cameraExposureOffset(m, "CameraExposureOffset");
5657
py::enum_<Colormap> colormap(m, "Colormap", DOC(dai, Colormap));
58+
py::enum_<FrameEvent> frameEvent(m, "FrameEvent", DOC(dai, FrameEvent));
5759

5860
///////////////////////////////////////////////////////////////////////
5961
///////////////////////////////////////////////////////////////////////
@@ -328,4 +330,10 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
328330
// .value("DEEPGREEN", Colormap::DEEPGREEN)
329331
;
330332

333+
frameEvent
334+
.value("NONE", FrameEvent::NONE)
335+
.value("READOUT_START", FrameEvent::READOUT_START)
336+
.value("READOUT_END", FrameEvent::READOUT_END)
337+
;
338+
331339
}

utilities/device_manager.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,22 @@ def wait(self) -> dai.DeviceInfo:
185185
return deviceSelected
186186

187187
def flashBootloader(bl: dai.DeviceBootloader, device: dai.DeviceInfo, type: dai.DeviceBootloader.Type):
188+
userBlWarningMessage = """Updating bootloader can soft-brick a device.
189+
Proceed with caution"""
188190
factoryBlWarningMessage = """Factory Bootloader type or version doesn't support User Bootloader flashing.
189191
Factory bootloader will be updated instead.
190192
Proceed with caution
191193
"""
192194

193195
try:
194196
if bl.isUserBootloaderSupported():
195-
pr = Progress('Flashing...')
196-
progress = lambda p : pr.update(p)
197-
bl.flashUserBootloader(progress)
198-
pr.finish("Flashed newest User Bootloader version.")
197+
if AreYouSure(text=userBlWarningMessage).wait():
198+
pr = Progress('Flashing...')
199+
progress = lambda p : pr.update(p)
200+
bl.flashUserBootloader(progress)
201+
pr.finish("Flashed newest User Bootloader version.")
202+
else:
203+
return False
199204
elif AreYouSure(text=factoryBlWarningMessage).wait():
200205
bl.close()
201206
pr = Progress('Connecting...')
@@ -400,12 +405,6 @@ def deviceStateTxt(state: dai.XLinkDeviceState) -> str:
400405
sg.Text("-version-", key="version", size=(30, 1)),
401406
sg.VSeparator(),
402407
sg.Text("-version-", key="commit", size=(31, 1))
403-
],
404-
[sg.HSeparator()],
405-
[
406-
sg.Text("", size=(7, 2)),
407-
sg.Button("Update Bootloader", size=(20, 2), font=('Arial', 10, 'bold'), disabled=True,
408-
button_color='#FFA500'),
409408
]
410409
]
411410

@@ -510,12 +509,17 @@ def deviceStateTxt(state: dai.XLinkDeviceState) -> str:
510509
],
511510
[sg.HSeparator()],
512511
[
512+
sg.Button("Update Bootloader", size=(20, 2), font=('Arial', 10, 'bold'), disabled=True,
513+
button_color='#FFA500'),
513514
sg.Button("Flash Factory Bootloader", size=(20, 2), font=('Arial', 10, 'bold'), disabled=True,
514515
button_color='#FFA500', key='flashFactoryBootloader'),
516+
],
517+
[sg.HSeparator()],
518+
[
515519
sg.Button("Factory reset", size=(17, 2), font=('Arial', 10, 'bold'), disabled=True, button_color='#FFA500'),
516520
sg.Button("Boot into USB\nRecovery mode", size=(20, 2), font=('Arial', 10, 'bold'), disabled=True,
517521
key='recoveryMode', button_color='#FFA500')
518-
],
522+
]
519523
]
520524

521525

@@ -611,6 +615,8 @@ def run(self) -> None:
611615
if self.bl is None: continue
612616
self.getConfigs()
613617
self.unlockConfig()
618+
619+
# Danger
614620
elif event == "Update Bootloader":
615621
# Use current type
616622
if flashBootloader(self.bl, self.device, self.bl.getType()):
@@ -620,8 +626,6 @@ def run(self) -> None:
620626
self.getDevices()
621627
else:
622628
print("Flashing bootloader canceled.")
623-
624-
# Danger
625629
elif event == "flashFactoryBootloader":
626630
sel = SelectBootloader(['AUTO', 'USB', 'NETWORK'], "Select bootloader type to flash.")
627631
ok, type = sel.wait()

0 commit comments

Comments
 (0)