Skip to content

Commit 8c49596

Browse files
Merge pull request #63 from luxonis/release_0_3_0_0
Release 0.3.0.0
2 parents 9b0df83 + 760a76c commit 8c49596

11 files changed

+348
-129
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,29 +153,29 @@ jobs:
153153
path: wheelhouse/audited/
154154

155155
# Run tests
156-
tests:
157-
runs-on: luxonis-arm-tests
158-
needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
159-
steps:
160-
- uses: actions/checkout@v2
161-
with:
162-
submodules: 'recursive'
163-
- uses: actions/download-artifact@v2
164-
with:
165-
name: audited-wheels
166-
path: wheels/depthai/
167-
- name: List files
168-
run: ls -lah
169-
- name: install DepthAI
170-
run: python3.7 -m pip install depthai --no-index --find-links file://`pwd`/wheels/depthai/
171-
- name: Run tests
172-
run: python3.7 tests/test.py
156+
# tests:
157+
# runs-on: luxonis-arm-tests
158+
# needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
159+
# steps:
160+
# - uses: actions/checkout@v2
161+
# with:
162+
# submodules: 'recursive'
163+
# - uses: actions/download-artifact@v2
164+
# with:
165+
# name: audited-wheels
166+
# path: wheels/depthai/
167+
# - name: List files
168+
# run: ls -lah
169+
# - name: install DepthAI
170+
# run: python3.7 -m pip install depthai --no-index --find-links file://`pwd`/wheels/depthai/
171+
# - name: Run tests
172+
# run: python3.7 tests/test.py
173173

174174
# Deploy to artifactory
175175
deploy-artifacts:
176176
if: startsWith(github.ref, 'refs/tags/v') != true
177177
runs-on: ubuntu-latest
178-
needs: tests
178+
needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
179179
steps:
180180
- uses: actions/checkout@v2
181181
with:
@@ -197,7 +197,7 @@ jobs:
197197
deploy-pypi:
198198
if: startsWith(github.ref, 'refs/tags/v')
199199
runs-on: ubuntu-latest
200-
needs: tests
200+
needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
201201
steps:
202202
- uses: actions/checkout@v2
203203
with:

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "depthai-core"]
22
path = depthai-core
3-
url = https://github.com/luxonis/depthai-core.git
3+
url = ../depthai-core.git

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endif()
2020

2121
# Pybindings project
2222
set(TARGET_NAME depthai)
23-
project(${TARGET_NAME} VERSION "1") # revision of bindings [depthai-core].[rev]
23+
project(${TARGET_NAME} VERSION "0") # revision of bindings [depthai-core].[rev]
2424

2525
# Add depthai-cpp dependency
2626
add_subdirectory(depthai-core EXCLUDE_FROM_ALL)
@@ -40,7 +40,6 @@ pybind11_add_module(${TARGET_NAME}
4040
src/py_bindings.cpp
4141
src/host_data_packet_bindings.cpp
4242
src/nnet_packet_bindings.cpp
43-
src/py_tensor_entry_container_iterator.cpp
4443
src/device_bindings.cpp
4544
)
4645

@@ -54,7 +53,10 @@ target_link_libraries(${TARGET_NAME}
5453

5554
# Add bindings revision
5655
target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_BINDINGS_REVISION="${PROJECT_VERSION}")
57-
# Add commit hash
56+
# Add commit hash, default to "dev"
57+
if(NOT DEPTHAI_PYTHON_COMMIT_HASH)
58+
set(DEPTHAI_PYTHON_COMMIT_HASH dev)
59+
endif()
5860
if(DEPTHAI_PYTHON_COMMIT_HASH)
5961
target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_COMMIT_HASH="${DEPTHAI_PYTHON_COMMIT_HASH}")
6062
endif()

src/device_bindings.cpp

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,59 @@ void init_binding_device(pybind11::module& m){
7171
"Function to send disparity confidence threshold for SGBM"
7272
)
7373

74+
.def(
75+
"send_camera_control",
76+
&Device::send_camera_control,
77+
"Function to send an ISP 3A camera control command. "
78+
"args: 'Cam3A.__members__', 'Isp3A.__members__', extra_args: 'string, space separated values https://git.io/JUpnJ '",
79+
py::arg("camera_id"),
80+
py::arg("command_id"),
81+
py::arg("extra_args")
82+
)
83+
7484
.def(
7585
"get_nn_to_depth_bbox_mapping",
7686
&Device::get_nn_to_depth_bbox_mapping,
7787
"Returns NN bounding-box to depth mapping as a dict of coords: off_x, off_y, max_w, max_h."
7888
)
7989

90+
// calibration data bindings
91+
.def(
92+
"get_left_intrinsic",
93+
&Device::get_left_intrinsic,
94+
"Returns 3x3 matrix defining the intrinsic parameters of the left camera of the stereo setup."
95+
)
96+
97+
.def(
98+
"get_left_homography",
99+
&Device::get_left_homography,
100+
"Returns 3x3 matrix defining the homography to rectify the left camera of the stereo setup."
101+
)
102+
103+
.def(
104+
"get_right_intrinsic",
105+
&Device::get_right_intrinsic,
106+
"Returns 3x3 matrix defining the intrinsic parameters of the right camera of the stereo setup."
107+
)
108+
109+
.def(
110+
"get_right_homography",
111+
&Device::get_right_homography,
112+
"Returns 3x3 matrix defining the homography to rectify the right camera of the stereo setup."
113+
)
114+
115+
.def(
116+
"get_rotation",
117+
&Device::get_rotation,
118+
"Returns 3x3 matrix defining how much the right camera is rotated w.r.t left camera."
119+
)
120+
121+
.def(
122+
"get_translation",
123+
&Device::get_translation,
124+
"Returns a vector defining how much the right camera is translated w.r.t left camera."
125+
)
126+
80127

81128

82129
;
@@ -90,5 +137,51 @@ void init_binding_device(pybind11::module& m){
90137
.value("AF_MODE_EDOF", CaptureMetadata::AutofocusMode::AF_MODE_EDOF)
91138
;
92139

140+
py::class_<CameraControl> cameraControl(m, "CameraControl");
141+
142+
py::enum_<CameraControl::CamId>(cameraControl, "CamId")
143+
.value("RGB", CameraControl::CamId::RGB)
144+
.value("LEFT", CameraControl::CamId::LEFT)
145+
.value("RIGHT", CameraControl::CamId::RIGHT)
146+
;
147+
148+
py::enum_<CameraControl::Command>(cameraControl, "Command")
149+
.value("START_STREAM", CameraControl::Command::START_STREAM)
150+
.value("STOP_STREAM", CameraControl::Command::STOP_STREAM)
151+
.value("REQUEST_STILL", CameraControl::Command::REQUEST_STILL)
152+
.value("MOVE_LENS", CameraControl::Command::MOVE_LENS)
153+
.value("FOCUS_TRIGGER", CameraControl::Command::FOCUS_TRIGGER)
154+
.value("AE_MANUAL", CameraControl::Command::AE_MANUAL)
155+
.value("AE_AUTO", CameraControl::Command::AE_AUTO)
156+
.value("SET_AWB_MODE", CameraControl::Command::SET_AWB_MODE)
157+
.value("SCENE_MODES", CameraControl::Command::SCENE_MODES)
158+
.value("ANTIBANDING_MODES", CameraControl::Command::ANTIBANDING_MODES)
159+
.value("EXPOSURE_COMPENSATION", CameraControl::Command::EXPOSURE_COMPENSATION)
160+
.value("AE_LOCK", CameraControl::Command::AE_LOCK)
161+
.value("AE_TARGET_FPS_RANGE", CameraControl::Command::AE_TARGET_FPS_RANGE)
162+
.value("AWB_LOCK", CameraControl::Command::AWB_LOCK)
163+
.value("CAPTURE_INTENT", CameraControl::Command::CAPTURE_INTENT)
164+
.value("CONTROL_MODE", CameraControl::Command::CONTROL_MODE)
165+
.value("FRAME_DURATION", CameraControl::Command::FRAME_DURATION)
166+
.value("SENSITIVITY", CameraControl::Command::SENSITIVITY)
167+
.value("EFFECT_MODE", CameraControl::Command::EFFECT_MODE)
168+
.value("AF_MODE", CameraControl::Command::AF_MODE)
169+
.value("NOISE_REDUCTION_STRENGTH", CameraControl::Command::NOISE_REDUCTION_STRENGTH)
170+
.value("SATURATION", CameraControl::Command::SATURATION)
171+
.value("BRIGHTNESS", CameraControl::Command::BRIGHTNESS)
172+
.value("STREAM_FORMAT", CameraControl::Command::STREAM_FORMAT)
173+
.value("CAM_RESOLUTION", CameraControl::Command::CAM_RESOLUTION)
174+
.value("SHARPNESS", CameraControl::Command::SHARPNESS)
175+
.value("CUSTOM_USECASE", CameraControl::Command::CUSTOM_USECASE)
176+
.value("CUSTOM_CAPT_MODE", CameraControl::Command::CUSTOM_CAPT_MODE)
177+
.value("CUSTOM_EXP_BRACKETS", CameraControl::Command::CUSTOM_EXP_BRACKETS)
178+
.value("CUSTOM_CAPTURE", CameraControl::Command::CUSTOM_CAPTURE)
179+
.value("CONTRAST", CameraControl::Command::CONTRAST)
180+
.value("AE_REGION", CameraControl::Command::AE_REGION)
181+
.value("AF_REGION", CameraControl::Command::AF_REGION)
182+
.value("LUMA_DENOISE", CameraControl::Command::LUMA_DENOISE)
183+
.value("CHROMA_DENOISE", CameraControl::Command::CHROMA_DENOISE)
184+
;
185+
93186
}
94187

src/host_data_packet_bindings.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ void init_binding_host_data_packet(pybind11::module& m){
7373

7474
}
7575

76-
76+
// TODO - zero copy
77+
//https://github.com/pybind/pybind11/issues/323#issuecomment-575717041
78+
//https://github.com/pybind/pybind11/issues/1042#issuecomment-642215028
7779
py::array* PyHostDataPacket::getPythonNumpyArray()
7880
{
7981
assert(!dimensions.empty());
80-
assert(!data.empty());
82+
assert(!data->empty());
8183

8284
Timer t;
8385

@@ -103,7 +105,7 @@ py::array* PyHostDataPacket::getPythonNumpyArray()
103105
if (elem_size == 1)
104106
{
105107
result = new py::array(py::buffer_info(
106-
data.data(), /* data as contiguous array */
108+
data->data(), /* data as contiguous array */
107109
sizeof(unsigned char), /* size of one scalar */
108110
py::format_descriptor<unsigned char>::format(), /* data type */
109111
ndim, /* number of dimensions */
@@ -114,7 +116,7 @@ py::array* PyHostDataPacket::getPythonNumpyArray()
114116
else if (elem_size == 2)
115117
{
116118
result = new py::array(py::buffer_info(
117-
data.data(), /* data as contiguous array */
119+
data->data(), /* data as contiguous array */
118120
sizeof(std::uint16_t), /* size of one scalar */
119121
py::format_descriptor<std::uint16_t>::format(), /* data type */
120122
2, //ndim, /* number of dimensions */

0 commit comments

Comments
 (0)