66#include < string>
77#include < vector>
88
9+ #include " pybind11_common.hpp"
10+
11+
912#ifdef _MSC_VER
1013 #define HAVE_SNPRINTF
1114#endif
2528#include " device_bindings.hpp"
2629
2730
28- namespace py = pybind11;
29-
30- PYBIND11_MAKE_OPAQUE (std::list<std::shared_ptr<HostDataPacket>>);
31- PYBIND11_MAKE_OPAQUE (std::list<std::shared_ptr<NNetPacket>>);
3231
3332
33+ namespace py = pybind11;
3434PYBIND11_MODULE (depthai,m)
3535{
3636
@@ -47,18 +47,6 @@ PYBIND11_MODULE(depthai,m)
4747 m.attr (" __dev_version__" ) = " badf00d" ;
4848
4949
50- // nnet_packets, DATA_PACKETS = p.get_available_nnet_and_data_packets()
51- py::class_<std::list<std::shared_ptr<HostDataPacket>>>(m, " DataPacketList" )
52- .def (py::init<>())
53- .def (" __len__" , [](const std::list<std::shared_ptr<HostDataPacket>> &v) { return v.size (); })
54- .def (" __iter__" , [](std::list<std::shared_ptr<HostDataPacket>> &v)
55- {
56- return py::make_iterator (v.begin (), v.end ());
57- }, py::keep_alive<0 , 1 >()) /* Keep list alive while iterator is used */
58- ;
59-
60-
61-
6250 // for te in nnet_packet.ENTRIES()
6351 py::class_<TensorEntryContainer, std::shared_ptr<TensorEntryContainer>>(m, " TensorEntryContainer" )
6452 .def (" __len__" , &TensorEntryContainer::size)
@@ -102,12 +90,12 @@ PYBIND11_MODULE(depthai,m)
10290
10391
10492 py::class_<HostPipeline>(m, " Pipeline" )
105- .def (" get_available_data_packets" , &HostPipeline::getAvailableDataPackets, py::return_value_policy::copy)
93+ .def (" get_available_data_packets" , &HostPipeline::getAvailableDataPackets, py::arg ( " blocking " ) = false , py:: return_value_policy::copy)
10694 ;
10795
10896 py::class_<CNNHostPipeline, std::shared_ptr<CNNHostPipeline>>(m, " CNNPipeline" )
109- .def (" get_available_data_packets" , &CNNHostPipeline::getAvailableDataPackets, py::return_value_policy::copy)
110- .def (" get_available_nnet_and_data_packets" , &CNNHostPipeline::getAvailableNNetAndDataPackets, py::return_value_policy::copy)
97+ .def (" get_available_data_packets" , &CNNHostPipeline::getAvailableDataPackets, py::arg ( " blocking " ) = false , py:: return_value_policy::copy)
98+ .def (" get_available_nnet_and_data_packets" , &CNNHostPipeline::getAvailableNNetAndDataPackets, py::arg ( " blocking " ) = false , py:: return_value_policy::copy)
11199 ;
112100
113101
0 commit comments