Skip to content

Commit

Permalink
Merge branch 'release_2.17.2.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed Jul 27, 2022
2 parents c9abca8 + 8855548 commit 334ba54
Show file tree
Hide file tree
Showing 52 changed files with 4,197 additions and 2,918 deletions.
46 changes: 45 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,55 @@ pybind11_add_module(${TARGET_NAME}
src/DatatypeBindings.cpp
src/DataQueueBindings.cpp
src/pipeline/PipelineBindings.cpp
src/pipeline/NodeBindings.cpp
src/pipeline/CommonBindings.cpp
src/pipeline/AssetManagerBindings.cpp
src/openvino/OpenVINOBindings.cpp
src/log/LogBindings.cpp

src/pipeline/node/NodeBindings.cpp

src/pipeline/node/XLinkInBindings.cpp
src/pipeline/node/XLinkOutBindings.cpp
src/pipeline/node/ColorCameraBindings.cpp
src/pipeline/node/MonoCameraBindings.cpp
src/pipeline/node/StereoDepthBindings.cpp
src/pipeline/node/NeuralNetworkBindings.cpp
src/pipeline/node/VideoEncoderBindings.cpp
src/pipeline/node/ImageManipBindings.cpp
src/pipeline/node/SPIOutBindings.cpp
src/pipeline/node/SPIInBindings.cpp
src/pipeline/node/DetectionNetworkBindings.cpp
src/pipeline/node/SystemLoggerBindings.cpp
src/pipeline/node/ScriptBindings.cpp
src/pipeline/node/SpatialLocationCalculatorBindings.cpp
src/pipeline/node/SpatialDetectionNetworkBindings.cpp
src/pipeline/node/ObjectTrackerBindings.cpp
src/pipeline/node/IMUBindings.cpp
src/pipeline/node/EdgeDetectorBindings.cpp
src/pipeline/node/FeatureTrackerBindings.cpp
src/pipeline/node/AprilTagBindings.cpp
src/pipeline/node/DetectionParserBindings.cpp

src/pipeline/datatype/ADatatypeBindings.cpp
src/pipeline/datatype/AprilTagConfigBindings.cpp
src/pipeline/datatype/AprilTagsBindings.cpp
src/pipeline/datatype/BufferBindings.cpp
src/pipeline/datatype/CameraControlBindings.cpp
src/pipeline/datatype/EdgeDetectorConfigBindings.cpp
src/pipeline/datatype/FeatureTrackerConfigBindings.cpp
src/pipeline/datatype/ImageManipConfigBindings.cpp
src/pipeline/datatype/ImgDetectionsBindings.cpp
src/pipeline/datatype/ImgFrameBindings.cpp
src/pipeline/datatype/IMUDataBindings.cpp
src/pipeline/datatype/NNDataBindings.cpp
src/pipeline/datatype/SpatialImgDetectionsBindings.cpp
src/pipeline/datatype/SpatialLocationCalculatorConfigBindings.cpp
src/pipeline/datatype/SpatialLocationCalculatorDataBindings.cpp
src/pipeline/datatype/StereoDepthConfigBindings.cpp
src/pipeline/datatype/SystemInformationBindings.cpp
src/pipeline/datatype/TrackedFeaturesBindings.cpp
src/pipeline/datatype/TrackletsBindings.cpp

)

if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion examples/ObjectTracker/object_tracker_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def displayFrame(name, frame):
cap = cv2.VideoCapture(args.videoPath)
baseTs = time.monotonic()
simulatedFps = 30
inputFrameShape = (1280, 720)
inputFrameShape = (1920, 1080)

while cap.isOpened():
read_correctly, frame = cap.read()
Expand Down
1,634 changes: 42 additions & 1,592 deletions src/DatatypeBindings.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/DatatypeBindings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#include "pybind11_common.hpp"

struct DatatypeBindings {
static void bind(pybind11::module& m, void* pCallstack);
static void addToCallstack(std::deque<StackFunction>& callstack);
};
31 changes: 31 additions & 0 deletions src/pipeline/CommonBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "depthai-shared/common/UsbSpeed.hpp"
#include "depthai-shared/common/DetectionNetworkType.hpp"
#include "depthai-shared/common/DetectionParserOptions.hpp"
#include "depthai-shared/common/RotatedRect.hpp"
#include "depthai-shared/common/Rect.hpp"

void CommonBindings::bind(pybind11::module& m, void* pCallstack){

Expand All @@ -39,6 +41,8 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
py::enum_<DetectionNetworkType> detectionNetworkType(m, "DetectionNetworkType");
py::enum_<SerializationType> serializationType(m, "SerializationType");
py::class_<DetectionParserOptions> detectionParserOptions(m, "DetectionParserOptions", DOC(dai, DetectionParserOptions));
py::class_<RotatedRect> rotatedRect(m, "RotatedRect", DOC(dai, RotatedRect));
py::class_<Rect> rect(m, "Rect", DOC(dai, Rect));

///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
Expand All @@ -53,6 +57,33 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////

rotatedRect
.def(py::init<>())
.def_readwrite("center", &RotatedRect::center)
.def_readwrite("size", &RotatedRect::size)
.def_readwrite("angle", &RotatedRect::angle)
;

rect
.def(py::init<>())
.def(py::init<float, float, float, float>())
.def(py::init<Point2f, Point2f>())
.def(py::init<Point2f, Size2f>())

.def("topLeft", &Rect::topLeft, DOC(dai, Rect, topLeft))
.def("bottomRight", &Rect::bottomRight, DOC(dai, Rect, bottomRight))
.def("size", &Rect::size, DOC(dai, Rect, size))
.def("area", &Rect::area, DOC(dai, Rect, area))
.def("empty", &Rect::empty, DOC(dai, Rect, empty))
.def("contains", &Rect::contains, DOC(dai, Rect, contains))
.def("isNormalized", &Rect::isNormalized, DOC(dai, Rect, isNormalized))
.def("denormalize", &Rect::denormalize, py::arg("width"), py::arg("height"), DOC(dai, Rect, denormalize))
.def("normalize", &Rect::normalize, py::arg("width"), py::arg("height"), DOC(dai, Rect, normalize))
.def_readwrite("x", &Rect::x)
.def_readwrite("y", &Rect::y)
.def_readwrite("width", &Rect::width)
.def_readwrite("height", &Rect::height)
;

timestamp
.def(py::init<>())
Expand Down
Loading

0 comments on commit 334ba54

Please sign in to comment.