Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
925ed91
Merge changes from enhance_stereo_depth into develop
Sep 10, 2020
5a0f4a3
Update depthai-core submodule
Sep 10, 2020
225a169
Updated core and added a zero-copy TODO
themarpe Sep 10, 2020
4d6b8f4
Updated core
themarpe Sep 10, 2020
195ff38
Merge remote-tracking branch 'origin/main' into enhance_stereo_depth_…
Sep 10, 2020
c85122b
Updated core
themarpe Sep 10, 2020
474de6e
Updated core
themarpe Sep 10, 2020
4d7757a
Merge branch 'develop' into raw-color
themarpe Sep 11, 2020
2d027b2
Merge branch 'raw-color' into develop
themarpe Sep 11, 2020
3b60ed5
updated get_translation api
saching13 Sep 11, 2020
4bb2a5c
replacing homography with R1 and R2 and adding distortion coefficient…
saching13 Sep 12, 2020
688461c
tested and fixed some syntax errors. Added version check and abort on…
saching13 Sep 14, 2020
77a9738
Update depthai-core submodule: EEPROM V5
alex-luxonis Sep 14, 2020
670e597
fixed get_left_homography() by adding matrix ops
saching13 Sep 15, 2020
8688629
added math ops in depthai-core. mesh WIP and disbaled
saching13 Sep 15, 2020
9c0aab6
refactored depthai-core
saching13 Sep 15, 2020
91b7696
added version check on calibration adjustments in depthai-core
saching13 Sep 15, 2020
4416f64
bug fix for version 3 depthai-core
saching13 Sep 15, 2020
0ceed8e
Update depthai-core
Sep 15, 2020
e7332dd
Update depthai-core: rectified L/R swapping corrected
alex-luxonis Sep 15, 2020
feb6268
Merge pull request #47 from luxonis/enhance_stereo_depth_develop
SzabolcsGergely Sep 15, 2020
6a49d01
Update depthai-core submodule
Sep 16, 2020
b8fd253
Change git submodule url to relative path to inherit ssh/https option
Sep 16, 2020
34fb671
Fix build error
Sep 16, 2020
e0a260d
Merge pull request #49 from luxonis/rename_depth_raw
SzabolcsGergely Sep 17, 2020
21b4a64
Merge in initial version of openvino tensor representation
Sep 18, 2020
4ccbbbf
Update depthai-core submodule
Sep 18, 2020
690d622
Update depthai-core submodule
Sep 18, 2020
4de8abf
fixed watchdog error
saching13 Sep 18, 2020
8cf9e41
Merge pull request #50 from luxonis/calibration_fix
SzabolcsGergely Sep 18, 2020
57f3024
Fix memory leak in getOutputsList, getOutputsDict
Sep 19, 2020
82b9e1a
Add #include depthai-shared/cnn_info.hpp explicitly
Sep 19, 2020
f3d9f93
Use map instead unordered_map
Sep 19, 2020
83af6e6
Add input,output tensor descriptor getter; improve API
Sep 21, 2020
3bad643
Cleanup API, add iterator for detections; wrap packet data in shared_ptr
Sep 22, 2020
688de54
Add support to run network without user defined JSON
Sep 22, 2020
f15fb4f
Update core submodule
Sep 23, 2020
cca8c2b
Add get_dimension to python API
Sep 23, 2020
69abbc5
Merge remote-tracking branch 'origin/develop' into HEAD
Sep 23, 2020
5faedf6
Update core submodule
Sep 23, 2020
b55ccbb
Update core submodule
Sep 23, 2020
b7fab35
Add ISP 3A camera controls
alex-luxonis Sep 28, 2020
c1af2c2
Address PR review; rename dimension to Dimension, detections_out_t to…
Oct 5, 2020
601755e
Update python api
Oct 5, 2020
1038d88
Update depthai-core
Oct 5, 2020
2255634
Update depthai-core
Oct 5, 2020
7987bd8
TMP: Disable tests in CI
Oct 5, 2020
50ea03c
[TMP] CI: remove 'tests' dependency from 'deploy-artifacts'
alex-luxonis Oct 5, 2020
c7e197f
Slightly refactor CameraControl API
alex-luxonis Oct 5, 2020
de9f580
Update depthai-core
alex-luxonis Oct 5, 2020
cdd1f23
Fix default camera resolution/fps if not specified
Oct 6, 2020
b4943f5
Merge pull request #51 from luxonis/openvino_tensor_representation_de…
SzabolcsGergely Oct 6, 2020
3aa41b9
Adapt Cam3A/Isp3A for enum name change. Add note to API
alex-luxonis Oct 7, 2020
958eb14
Revert "[TMP] CI: remove 'tests' dependency from 'deploy-artifacts'"
alex-luxonis Oct 7, 2020
25f309e
Merge remote-tracking branch 'origin/develop' into isp_3a_controls_de…
alex-luxonis Oct 7, 2020
78f0f40
Address review comments:
alex-luxonis Oct 7, 2020
70d2d9b
Merge pull request #52 from luxonis/isp_3a_controls_develop
alex-luxonis Oct 7, 2020
406f48b
Update depthai-core: support for NN on stereo rectified frames
alex-luxonis Oct 7, 2020
9de8e98
Merge pull request #53 from luxonis/nn_stereo_rectified
SzabolcsGergely Oct 8, 2020
bee757d
Fix get_dict() methods for TensorInfo and Detection
Oct 12, 2020
c377d8d
Merge pull request #54 from luxonis/fix_get_dict_methods
SzabolcsGergely Oct 12, 2020
186e9fd
Update depthai-core: fix sporadic scaling issue or crash,
alex-luxonis Oct 12, 2020
a3ac97a
Merge pull request #55 from luxonis/fix_nn_stereo_rectified
SzabolcsGergely Oct 12, 2020
4dd7e7a
Remove depth_confidence threshold; fix confidence threshold for mobil…
Oct 13, 2020
c770023
Updated core
themarpe Oct 13, 2020
fd0239e
Throw error if depth confidence threshold is used
Oct 13, 2020
f91a36f
Merge remote-tracking branch 'origin/develop' into HEAD
Oct 14, 2020
a2a8bc7
Merge pull request #57 from luxonis/fix_confidence_threshold
SzabolcsGergely Oct 14, 2020
fe3741e
Default DEPTHAI_PYTHON_COMMIT_HASH to "dev".
alex-luxonis Oct 15, 2020
566287c
Update depthai-core: update XLink, usb_chunk_KiB option
alex-luxonis Oct 16, 2020
ad04e96
Merge pull request #58 from luxonis/gen1_updates
alex-luxonis Oct 17, 2020
251b4a7
Check if output format matches the one in config
Oct 19, 2020
7f6f4bd
Add check for 2 stage network
Oct 19, 2020
09142c2
Fix array indexing error
Oct 20, 2020
b89598d
Merge pull request #59 from luxonis/output_format_checks
SzabolcsGergely Oct 20, 2020
5224960
Update depthai-core: fix X,Y,Z calc on NN bounding box
alex-luxonis Oct 23, 2020
5eb9ea9
Merge pull request #61 from luxonis/fix_xyz_calc
alex-luxonis Oct 23, 2020
a20aa10
Merge pull request #60 from luxonis/develop
VanDavv Oct 26, 2020
760a76c
bump version to 0.3.0.0
VanDavv Oct 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,29 +153,29 @@ jobs:
path: wheelhouse/audited/

# Run tests
tests:
runs-on: luxonis-arm-tests
needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/download-artifact@v2
with:
name: audited-wheels
path: wheels/depthai/
- name: List files
run: ls -lah
- name: install DepthAI
run: python3.7 -m pip install depthai --no-index --find-links file://`pwd`/wheels/depthai/
- name: Run tests
run: python3.7 tests/test.py
# tests:
# runs-on: luxonis-arm-tests
# needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# - uses: actions/download-artifact@v2
# with:
# name: audited-wheels
# path: wheels/depthai/
# - name: List files
# run: ls -lah
# - name: install DepthAI
# run: python3.7 -m pip install depthai --no-index --find-links file://`pwd`/wheels/depthai/
# - name: Run tests
# run: python3.7 tests/test.py

# Deploy to artifactory
deploy-artifacts:
if: startsWith(github.ref, 'refs/tags/v') != true
runs-on: ubuntu-latest
needs: tests
needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -197,7 +197,7 @@ jobs:
deploy-pypi:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: tests
needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "depthai-core"]
path = depthai-core
url = https://github.com/luxonis/depthai-core.git
url = ../depthai-core.git
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif()

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

# Add depthai-cpp dependency
add_subdirectory(depthai-core EXCLUDE_FROM_ALL)
Expand All @@ -40,7 +40,6 @@ pybind11_add_module(${TARGET_NAME}
src/py_bindings.cpp
src/host_data_packet_bindings.cpp
src/nnet_packet_bindings.cpp
src/py_tensor_entry_container_iterator.cpp
src/device_bindings.cpp
)

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

# Add bindings revision
target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_BINDINGS_REVISION="${PROJECT_VERSION}")
# Add commit hash
# Add commit hash, default to "dev"
if(NOT DEPTHAI_PYTHON_COMMIT_HASH)
set(DEPTHAI_PYTHON_COMMIT_HASH dev)
endif()
if(DEPTHAI_PYTHON_COMMIT_HASH)
target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_COMMIT_HASH="${DEPTHAI_PYTHON_COMMIT_HASH}")
endif()
Expand Down
93 changes: 93 additions & 0 deletions src/device_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,59 @@ void init_binding_device(pybind11::module& m){
"Function to send disparity confidence threshold for SGBM"
)

.def(
"send_camera_control",
&Device::send_camera_control,
"Function to send an ISP 3A camera control command. "
"args: 'Cam3A.__members__', 'Isp3A.__members__', extra_args: 'string, space separated values https://git.io/JUpnJ '",
py::arg("camera_id"),
py::arg("command_id"),
py::arg("extra_args")
)

.def(
"get_nn_to_depth_bbox_mapping",
&Device::get_nn_to_depth_bbox_mapping,
"Returns NN bounding-box to depth mapping as a dict of coords: off_x, off_y, max_w, max_h."
)

// calibration data bindings
.def(
"get_left_intrinsic",
&Device::get_left_intrinsic,
"Returns 3x3 matrix defining the intrinsic parameters of the left camera of the stereo setup."
)

.def(
"get_left_homography",
&Device::get_left_homography,
"Returns 3x3 matrix defining the homography to rectify the left camera of the stereo setup."
)

.def(
"get_right_intrinsic",
&Device::get_right_intrinsic,
"Returns 3x3 matrix defining the intrinsic parameters of the right camera of the stereo setup."
)

.def(
"get_right_homography",
&Device::get_right_homography,
"Returns 3x3 matrix defining the homography to rectify the right camera of the stereo setup."
)

.def(
"get_rotation",
&Device::get_rotation,
"Returns 3x3 matrix defining how much the right camera is rotated w.r.t left camera."
)

.def(
"get_translation",
&Device::get_translation,
"Returns a vector defining how much the right camera is translated w.r.t left camera."
)



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

py::class_<CameraControl> cameraControl(m, "CameraControl");

py::enum_<CameraControl::CamId>(cameraControl, "CamId")
.value("RGB", CameraControl::CamId::RGB)
.value("LEFT", CameraControl::CamId::LEFT)
.value("RIGHT", CameraControl::CamId::RIGHT)
;

py::enum_<CameraControl::Command>(cameraControl, "Command")
.value("START_STREAM", CameraControl::Command::START_STREAM)
.value("STOP_STREAM", CameraControl::Command::STOP_STREAM)
.value("REQUEST_STILL", CameraControl::Command::REQUEST_STILL)
.value("MOVE_LENS", CameraControl::Command::MOVE_LENS)
.value("FOCUS_TRIGGER", CameraControl::Command::FOCUS_TRIGGER)
.value("AE_MANUAL", CameraControl::Command::AE_MANUAL)
.value("AE_AUTO", CameraControl::Command::AE_AUTO)
.value("SET_AWB_MODE", CameraControl::Command::SET_AWB_MODE)
.value("SCENE_MODES", CameraControl::Command::SCENE_MODES)
.value("ANTIBANDING_MODES", CameraControl::Command::ANTIBANDING_MODES)
.value("EXPOSURE_COMPENSATION", CameraControl::Command::EXPOSURE_COMPENSATION)
.value("AE_LOCK", CameraControl::Command::AE_LOCK)
.value("AE_TARGET_FPS_RANGE", CameraControl::Command::AE_TARGET_FPS_RANGE)
.value("AWB_LOCK", CameraControl::Command::AWB_LOCK)
.value("CAPTURE_INTENT", CameraControl::Command::CAPTURE_INTENT)
.value("CONTROL_MODE", CameraControl::Command::CONTROL_MODE)
.value("FRAME_DURATION", CameraControl::Command::FRAME_DURATION)
.value("SENSITIVITY", CameraControl::Command::SENSITIVITY)
.value("EFFECT_MODE", CameraControl::Command::EFFECT_MODE)
.value("AF_MODE", CameraControl::Command::AF_MODE)
.value("NOISE_REDUCTION_STRENGTH", CameraControl::Command::NOISE_REDUCTION_STRENGTH)
.value("SATURATION", CameraControl::Command::SATURATION)
.value("BRIGHTNESS", CameraControl::Command::BRIGHTNESS)
.value("STREAM_FORMAT", CameraControl::Command::STREAM_FORMAT)
.value("CAM_RESOLUTION", CameraControl::Command::CAM_RESOLUTION)
.value("SHARPNESS", CameraControl::Command::SHARPNESS)
.value("CUSTOM_USECASE", CameraControl::Command::CUSTOM_USECASE)
.value("CUSTOM_CAPT_MODE", CameraControl::Command::CUSTOM_CAPT_MODE)
.value("CUSTOM_EXP_BRACKETS", CameraControl::Command::CUSTOM_EXP_BRACKETS)
.value("CUSTOM_CAPTURE", CameraControl::Command::CUSTOM_CAPTURE)
.value("CONTRAST", CameraControl::Command::CONTRAST)
.value("AE_REGION", CameraControl::Command::AE_REGION)
.value("AF_REGION", CameraControl::Command::AF_REGION)
.value("LUMA_DENOISE", CameraControl::Command::LUMA_DENOISE)
.value("CHROMA_DENOISE", CameraControl::Command::CHROMA_DENOISE)
;

}

10 changes: 6 additions & 4 deletions src/host_data_packet_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ void init_binding_host_data_packet(pybind11::module& m){

}


// TODO - zero copy
//https://github.com/pybind/pybind11/issues/323#issuecomment-575717041
//https://github.com/pybind/pybind11/issues/1042#issuecomment-642215028
py::array* PyHostDataPacket::getPythonNumpyArray()
{
assert(!dimensions.empty());
assert(!data.empty());
assert(!data->empty());

Timer t;

Expand All @@ -103,7 +105,7 @@ py::array* PyHostDataPacket::getPythonNumpyArray()
if (elem_size == 1)
{
result = new py::array(py::buffer_info(
data.data(), /* data as contiguous array */
data->data(), /* data as contiguous array */
sizeof(unsigned char), /* size of one scalar */
py::format_descriptor<unsigned char>::format(), /* data type */
ndim, /* number of dimensions */
Expand All @@ -114,7 +116,7 @@ py::array* PyHostDataPacket::getPythonNumpyArray()
else if (elem_size == 2)
{
result = new py::array(py::buffer_info(
data.data(), /* data as contiguous array */
data->data(), /* data as contiguous array */
sizeof(std::uint16_t), /* size of one scalar */
py::format_descriptor<std::uint16_t>::format(), /* data type */
2, //ndim, /* number of dimensions */
Expand Down
Loading