From 320cfa3969df8fed045bf70f3f40ad3e821ce1d5 Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Fri, 11 Jun 2021 18:15:08 +0900 Subject: [PATCH 1/9] Make `Node::getParentPipeline` publically available --- depthai-core | 2 +- src/pipeline/NodeBindings.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index e401bdaf2..f7832417f 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit e401bdaf2c4893cdf8a73cb25dc6eefcbc1b6939 +Subproject commit f7832417ff6609618cab9d690db960e234c71150 diff --git a/src/pipeline/NodeBindings.cpp b/src/pipeline/NodeBindings.cpp index c59455459..791880670 100644 --- a/src/pipeline/NodeBindings.cpp +++ b/src/pipeline/NodeBindings.cpp @@ -1,6 +1,7 @@ #include "NodeBindings.hpp" #include "depthai/pipeline/Node.hpp" +#include "depthai/pipeline/Pipeline.hpp" #include "depthai/pipeline/node/XLinkIn.hpp" #include "depthai/pipeline/node/XLinkOut.hpp" #include "depthai/pipeline/node/ColorCamera.hpp" @@ -34,6 +35,7 @@ void NodeBindings::bind(pybind11::module& m){ .def("getOutputs", &Node::getOutputs, DOC(dai, Node, getOutputs)) .def("getInputs", &Node::getInputs, DOC(dai, Node, getInputs)) .def("getAssets", &Node::getAssets, DOC(dai, Node, getAssets)) + .def("getParentPipeline", py::overload_cast<>(&Node::getParentPipeline, py::const_), DOC(dai, Node, getParentPipeline)) ; // Node::Input bindings From 782619ffe287f94af3ea12091ae2403764e10af7 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Wed, 14 Jul 2021 13:35:19 +0200 Subject: [PATCH 2/9] Added bindings for input and output references --- depthai-core | 2 +- src/pipeline/NodeBindings.cpp | 38 ++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/depthai-core b/depthai-core index 16e65db48..d4bc4d726 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 16e65db48705ef6a7e05fddd1776e195d3a1ce09 +Subproject commit d4bc4d7266f1fe95f8b928f04b04f15f4e1d62dc diff --git a/src/pipeline/NodeBindings.cpp b/src/pipeline/NodeBindings.cpp index 226006c67..9583ea37f 100644 --- a/src/pipeline/NodeBindings.cpp +++ b/src/pipeline/NodeBindings.cpp @@ -29,23 +29,30 @@ void NodeBindings::bind(pybind11::module& m){ // Base 'Node' class binding py::class_> pyNode(m, "Node", DOC(dai, Node)); - pyNode - .def_readonly("id", &Node::id, DOC(dai, Node, id)) - .def("getName", &Node::getName, DOC(dai, Node, getName)) - .def("getOutputs", &Node::getOutputs, DOC(dai, Node, getOutputs)) - .def("getInputs", &Node::getInputs, DOC(dai, Node, getInputs)) - .def("getAssets", &Node::getAssets, DOC(dai, Node, getAssets)) - ; + // Node::Input bindings - py::class_(pyNode, "Input", DOC(dai, Node, Input)) + py::class_ pyInput(pyNode, "Input", DOC(dai, Node, Input)); + py::enum_(pyInput, "Type") + .value("SReceiver", Node::Input::Type::SReceiver) + .value("MReceiver", Node::Input::Type::MReceiver) + ; + pyInput + .def_readonly("name", &Node::Input::name) + .def_readonly("type", &Node::Input::type) .def("setBlocking", &Node::Input::setBlocking, py::arg("blocking"), DOC(dai, Node, Input, setBlocking)) .def("getBlocking", &Node::Input::getBlocking, DOC(dai, Node, Input, getBlocking)) .def("setQueueSize", &Node::Input::setQueueSize, py::arg("size"), DOC(dai, Node, Input, setQueueSize)) .def("getQueueSize", &Node::Input::getQueueSize, DOC(dai, Node, Input, getQueueSize)) ; + // Node::Output bindings - py::class_(pyNode, "Output", DOC(dai, Node, Output)) + py::class_ pyOutput(pyNode, "Output", DOC(dai, Node, Output)); + py::enum_(pyOutput, "Type") + .value("MSender", Node::Output::Type::MSender) + .value("SSender", Node::Output::Type::SSender) + ; + pyOutput .def("canConnect", &Node::Output::canConnect, py::arg("in"), DOC(dai, Node, Output, canConnect)) .def("link", &Node::Output::link, py::arg("in"), DOC(dai, Node, Output, link)) .def("unlink", &Node::Output::unlink, py::arg("in"), DOC(dai, Node, Output, unlink)) @@ -61,6 +68,19 @@ void NodeBindings::bind(pybind11::module& m){ .def_property("inputId", [](Node::Connection& conn) { return conn.inputId; }, [](Node::Connection& conn, Node::Id id) {conn.inputId = id; }, DOC(dai, Node, Connection, inputId)) .def_property("inputName", [](Node::Connection& conn) { return conn.inputName; }, [](Node::Connection& conn, std::string name) {conn.inputName = name; }, DOC(dai, Node, Connection, inputName)) ; + + pyNode + .def_readonly("id", &Node::id, DOC(dai, Node, id)) + .def("getName", &Node::getName, DOC(dai, Node, getName)) + .def("getOutputs", &Node::getOutputs, DOC(dai, Node, getOutputs)) + .def("getInputs", &Node::getInputs, DOC(dai, Node, getInputs)) + .def("getAssets", &Node::getAssets, DOC(dai, Node, getAssets)) + .def("getOutputRefs", static_cast (Node::*)()>(&Node::getOutputRefs), DOC(dai, Node, getOutputRefs), py::return_value_policy::reference_internal) + .def("getInputRefs", static_cast (Node::*)()>(&Node::getInputRefs), DOC(dai, Node, getInputRefs), py::return_value_policy::reference_internal) + .def("getOutputRefs", static_cast (Node::*)() const>(&Node::getOutputRefs), DOC(dai, Node, getOutputRefs), py::return_value_policy::reference_internal) + .def("getInputRefs", static_cast (Node::*)() const>(&Node::getInputRefs), DOC(dai, Node, getInputRefs), py::return_value_policy::reference_internal) + ; + // MSVC errors out with: // Error C2326 'void NodeBindings::bind(pybind11::module &)': function cannot access 'dai::Node::Connection::outputId' // ... From dfae35510bb309a557373c0edc76fa75c893cabd Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Wed, 14 Jul 2021 14:26:51 +0200 Subject: [PATCH 3/9] Fixed queue reference --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index d4bc4d726..514941631 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit d4bc4d7266f1fe95f8b928f04b04f15f4e1d62dc +Subproject commit 514941631ea59923707f2143a0ea475100d2a904 From c1189906b0427861383f27ca1e68315a29f4dd77 Mon Sep 17 00:00:00 2001 From: Martin Peterlin Date: Wed, 14 Jul 2021 15:42:36 +0200 Subject: [PATCH 4/9] Fixed MSVC bug --- src/pipeline/NodeBindings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pipeline/NodeBindings.cpp b/src/pipeline/NodeBindings.cpp index 9583ea37f..891cf959c 100644 --- a/src/pipeline/NodeBindings.cpp +++ b/src/pipeline/NodeBindings.cpp @@ -38,8 +38,8 @@ void NodeBindings::bind(pybind11::module& m){ .value("MReceiver", Node::Input::Type::MReceiver) ; pyInput - .def_readonly("name", &Node::Input::name) - .def_readonly("type", &Node::Input::type) + .def_property_readonly("name", [](const Node::Input& input){ return input.name; }) + .def_property_readonly("type", [](const Node::Input& input){ return input.type; }) .def("setBlocking", &Node::Input::setBlocking, py::arg("blocking"), DOC(dai, Node, Input, setBlocking)) .def("getBlocking", &Node::Input::getBlocking, DOC(dai, Node, Input, getBlocking)) .def("setQueueSize", &Node::Input::setQueueSize, py::arg("size"), DOC(dai, Node, Input, setQueueSize)) From f279a520a778d1cfaf3e5e4b3c1a01d565c47245 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Wed, 14 Jul 2021 17:10:55 +0200 Subject: [PATCH 5/9] Updated core --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 514941631..db8ce0770 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 514941631ea59923707f2143a0ea475100d2a904 +Subproject commit db8ce0770425abbf5a82282df3b2a68bfe045abf From de997ec1d9d780f3ed1d23bef4102f8b8bb3cf7f Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Wed, 14 Jul 2021 18:33:49 +0200 Subject: [PATCH 6/9] Added bindings for DataQueue `close` and `isClosed` --- depthai-core | 2 +- src/DataQueueBindings.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index db8ce0770..1eafe370c 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit db8ce0770425abbf5a82282df3b2a68bfe045abf +Subproject commit 1eafe370cf96b9eb693114c05d52322f30112c16 diff --git a/src/DataQueueBindings.cpp b/src/DataQueueBindings.cpp index d0761ee6a..528cd494e 100644 --- a/src/DataQueueBindings.cpp +++ b/src/DataQueueBindings.cpp @@ -31,6 +31,8 @@ void DataQueueBindings::bind(pybind11::module& m){ }; py::class_>(m, "DataOutputQueue", DOC(dai, DataOutputQueue)) .def("getName", &DataOutputQueue::getName, DOC(dai, DataOutputQueue, getName)) + .def("isClosed", &DataOutputQueue::isClosed, DOC(dai, DataOutputQueue, isClosed)) + .def("close", &DataOutputQueue::close, DOC(dai, DataOutputQueue, close)) .def("addCallback", addCallbackLambda, py::arg("callback"), DOC(dai, DataOutputQueue, addCallback)) .def("addCallback", addCallbackLambda, py::arg("callback"), DOC(dai, DataOutputQueue, addCallback, 2)) @@ -92,6 +94,8 @@ void DataQueueBindings::bind(pybind11::module& m){ // Bind DataInputQueue py::class_>(m, "DataInputQueue", DOC(dai, DataInputQueue)) + .def("isClosed", &DataInputQueue::isClosed, DOC(dai, DataInputQueue, isClosed)) + .def("close", &DataInputQueue::close, DOC(dai, DataInputQueue, close)) .def("getName", &DataInputQueue::getName, DOC(dai, DataInputQueue, getName)) .def("setBlocking", &DataInputQueue::setBlocking, py::arg("blocking"), DOC(dai, DataInputQueue, setBlocking)) .def("getBlocking", &DataInputQueue::getBlocking, DOC(dai, DataInputQueue, getBlocking)) From fbfc4dd150b3565b29f0b703ab41c28ddba9f6d4 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 16 Jul 2021 09:47:06 +0300 Subject: [PATCH 7/9] Hotfix: fix NN memory allocation regression --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 0fbd13b98..6ae815c04 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 0fbd13b98ed147583ab82f8e46339f259f3c324b +Subproject commit 6ae815c044fbf76be62ebdfacb7eceea4a5bda8b From d420d2b389736a6166e55b637bcaafe3ff3f3b4f Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Sun, 18 Jul 2021 00:03:28 +0300 Subject: [PATCH 8/9] Update core: Update FW with SDK update --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index cc4300ed0..92b3830bc 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit cc4300ed09815988b40f358589f67140bd019400 +Subproject commit 92b3830bc3539060bd91479e711d2d709336011b From 4d82a4be33992243c13cc17f1e9ef1b6b03b80e8 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Mon, 19 Jul 2021 06:55:23 +0300 Subject: [PATCH 9/9] Bump version to 2.7.2.0 --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 92b3830bc..b4f28511e 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 92b3830bc3539060bd91479e711d2d709336011b +Subproject commit b4f28511ef6f56ca0f7233d20311bc2b960e8f26