@@ -64,14 +64,14 @@ void DatatypeBindings::bind(pybind11::module& m){
6464 .def_readwrite (" instanceNum" , &RawImgFrame::instanceNum)
6565 .def_readwrite (" sequenceNum" , &RawImgFrame::sequenceNum)
6666 .def_property (" ts" ,
67- [](const RawImgFrame& o){
68- double ts = o.ts .sec + o.ts .nsec / 1000000000.0 ;
69- return ts;
67+ [](const RawImgFrame& o){
68+ double ts = o.ts .sec + o.ts .nsec / 1000000000.0 ;
69+ return ts;
7070 },
71- [](RawImgFrame& o, double ts){
72- o.ts .sec = ts;
73- o.ts .nsec = (ts - o.ts .sec ) * 1000000000.0 ;
74- }
71+ [](RawImgFrame& o, double ts){
72+ o.ts .sec = ts;
73+ o.ts .nsec = (ts - o.ts .sec ) * 1000000000.0 ;
74+ }
7575 )
7676 ;
7777
@@ -150,7 +150,7 @@ void DatatypeBindings::bind(pybind11::module& m){
150150 .value (" FP32" , TensorInfo::DataType::FP32)
151151 .value (" I8" , TensorInfo::DataType::I8)
152152 ;
153-
153+
154154 py::enum_<TensorInfo::StorageOrder>(tensorInfo, " StorageOrder" )
155155 .value (" NHWC" , TensorInfo::StorageOrder::NHWC)
156156 .value (" NHCW" , TensorInfo::StorageOrder::NHCW)
@@ -194,7 +194,7 @@ void DatatypeBindings::bind(pybind11::module& m){
194194 .def (py::init<>())
195195 .def_readwrite (" detections" , &RawSpatialImgDetections::detections)
196196 ;
197-
197+
198198 // Bind RawImageManipConfig
199199 py::class_<RawImageManipConfig, RawBuffer, std::shared_ptr<RawImageManipConfig>> rawImageManipConfig (m, " RawImageManipConfig" , DOC (dai, RawImageManipConfig));
200200 rawImageManipConfig
@@ -277,7 +277,7 @@ void DatatypeBindings::bind(pybind11::module& m){
277277 .value (" TRACKED" , Tracklet::TrackingStatus::TRACKED)
278278 .value (" LOST" , Tracklet::TrackingStatus::LOST)
279279 ;
280-
280+
281281 // Bind RawTracklets
282282 py::class_<RawTracklets, RawBuffer, std::shared_ptr<RawTracklets>> rawTacklets (m, " RawTracklets" , DOC (dai, RawTracklets));
283283 rawTacklets
@@ -410,7 +410,7 @@ void DatatypeBindings::bind(pybind11::module& m){
410410
411411 py::array contiguous = numpy.attr (" ascontiguousarray" )(arr);
412412 frm.getData ().resize (contiguous.nbytes ());
413- memcpy (frm.getData ().data (), contiguous.data (), contiguous.nbytes ());
413+ memcpy (frm.getData ().data (), contiguous.data (), contiguous.nbytes ());
414414
415415 }, py::arg (" array" ), " Copies array bytes to ImgFrame buffer" )
416416 .def (" getFrame" , [](py::object &obj, bool copy){
@@ -426,14 +426,14 @@ void DatatypeBindings::bind(pybind11::module& m){
426426 // obj is "Python" object, which we used then to bind the numpy view lifespan to
427427 // creates numpy array (zero-copy) which holds correct information such as shape, ...
428428 auto & img = obj.cast <dai::ImgFrame&>();
429-
429+
430430 // shape
431431 bool valid = img.getWidth () > 0 && img.getHeight () > 0 ;
432432 std::vector<std::size_t > shape = {img.getData ().size ()};
433433 py::dtype dtype = py::dtype::of<uint8_t >();
434434
435435 switch (img.getType ()){
436-
436+
437437 case ImgFrame::Type::RGB888i :
438438 case ImgFrame::Type::BGR888i :
439439 // HWC
@@ -463,12 +463,12 @@ void DatatypeBindings::bind(pybind11::module& m){
463463 break ;
464464
465465 case ImgFrame::Type::GRAYF16:
466- shape = {img.getHeight (), img.getWidth ()};
466+ shape = {img.getHeight (), img.getWidth ()};
467467 dtype = py::dtype (" half" );
468468 break ;
469469
470470 case ImgFrame::Type::RAW16:
471- shape = {img.getHeight (), img.getWidth ()};
471+ shape = {img.getHeight (), img.getWidth ()};
472472 dtype = py::dtype::of<uint16_t >();
473473 break ;
474474
@@ -477,7 +477,7 @@ void DatatypeBindings::bind(pybind11::module& m){
477477 shape = {img.getHeight (), img.getWidth (), 3 };
478478 dtype = py::dtype (" half" );
479479 break ;
480-
480+
481481 case ImgFrame::Type::RGBF16F16F16p:
482482 case ImgFrame::Type::BGRF16F16F16p:
483483 shape = {3 , img.getHeight (), img.getWidth ()};
@@ -488,7 +488,7 @@ void DatatypeBindings::bind(pybind11::module& m){
488488 default :
489489 shape = {img.getData ().size ()};
490490 dtype = py::dtype::of<uint8_t >();
491- break ;
491+ break ;
492492 }
493493
494494 // Check if enough data
@@ -504,13 +504,13 @@ void DatatypeBindings::bind(pybind11::module& m){
504504 if (copy){
505505 py::array a (dtype, shape);
506506 std::memcpy (a.mutable_data (), img.getData ().data (), std::min ( (long ) (img.getData ().size ()), (long ) (a.nbytes ())));
507- return a;
507+ return a;
508508 } else {
509509 return py::array (dtype, shape, img.getData ().data (), obj);
510510 }
511511
512512 }, py::arg (" copy" ) = false , " Returns numpy array with shape as specified by width, height and type" )
513-
513+
514514 .def (" getCvFrame" , [](py::object &obj){
515515 using namespace pybind11 ::literals;
516516
@@ -744,9 +744,10 @@ void DatatypeBindings::bind(pybind11::module& m){
744744 .def (py::init<>())
745745 .def_readwrite (" config" , &SpatialLocations::config)
746746 .def_readwrite (" depthAverage" , &SpatialLocations::depthAverage)
747+ .def_readwrite (" depthAveragePixelCount" , &SpatialLocations::depthAveragePixelCount)
747748 .def_readwrite (" spatialCoordinates" , &SpatialLocations::spatialCoordinates)
748749 ;
749-
750+
750751
751752 py::class_<Rect> (m, " Rect" , DOC (dai, Rect))
752753 .def (py::init<>())
0 commit comments