Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion docs/source/components/pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The reason behind this is that OpenVINO doesn't provide version inside the blob.

pipeline = depthai.Pipeline()
# Set the correct version:
pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2020_1)
pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4)

How to place it
###############
Expand Down
2 changes: 1 addition & 1 deletion examples/imu_rotation_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def timeDeltaToMilliS(delta) -> float:
print(f"Rotation vector timestamp: {tsF.format(timeDeltaToMilliS(rvTs))} ms")
print(f"Quaternion: i: {imuF.format(rVvalues.i)} j: {imuF.format(rVvalues.j)} "
f"k: {imuF.format(rVvalues.k)} real: {imuF.format(rVvalues.real)}")
print(f"Accuracy (rad): {imuF.format(rVvalues.accuracy)}")
print(f"Accuracy (rad): {imuF.format(rVvalues.rotationVectorAccuracy)}")


if cv2.waitKey(1) == ord('q'):
Expand Down
23 changes: 17 additions & 6 deletions src/DatatypeBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ void DatatypeBindings::bind(pybind11::module& m){
o.ts.nsec = (ts - o.ts.sec) * 1000000000.0;
}
)
.def_property("tsDevice",
[](const RawImgFrame& o){
double ts = o.tsDevice.sec + o.tsDevice.nsec / 1000000000.0;
return ts;
},
[](RawImgFrame& o, double ts){
o.tsDevice.sec = ts;
o.tsDevice.nsec = (ts - o.tsDevice.sec) * 1000000000.0;
}
)
;

py::enum_<RawImgFrame::Type>(rawImgFrame, "Type")
Expand Down Expand Up @@ -304,11 +314,11 @@ void DatatypeBindings::bind(pybind11::module& m){
.def_readwrite("timestamp", &IMUReport::timestamp)
;

py::enum_<IMUReport::IMUReportAccuracy>(imureport, "IMUReportAccuracy")
.value("UNRELIABLE", IMUReport::IMUReportAccuracy::UNRELIABLE)
.value("LOW", IMUReport::IMUReportAccuracy::LOW)
.value("MEDIUM", IMUReport::IMUReportAccuracy::MEDIUM)
.value("HIGH", IMUReport::IMUReportAccuracy::HIGH)
py::enum_<IMUReport::Accuracy>(imureport, "Accuracy")
.value("UNRELIABLE", IMUReport::Accuracy::UNRELIABLE)
.value("LOW", IMUReport::Accuracy::LOW)
.value("MEDIUM", IMUReport::Accuracy::MEDIUM)
.value("HIGH", IMUReport::Accuracy::HIGH)
;

py::class_<IMUReportAccelerometer, IMUReport, std::shared_ptr<IMUReportAccelerometer>>(m, "IMUReportAccelerometer", DOC(dai, IMUReportAccelerometer))
Expand Down Expand Up @@ -338,7 +348,7 @@ void DatatypeBindings::bind(pybind11::module& m){
.def_readwrite("j", &IMUReportRotationVectorWAcc::j)
.def_readwrite("k", &IMUReportRotationVectorWAcc::k)
.def_readwrite("real", &IMUReportRotationVectorWAcc::real)
.def_readwrite("accuracy", &IMUReportRotationVectorWAcc::accuracy)
.def_readwrite("rotationVectorAccuracy", &IMUReportRotationVectorWAcc::rotationVectorAccuracy)
;

#if 0
Expand Down Expand Up @@ -521,6 +531,7 @@ void DatatypeBindings::bind(pybind11::module& m){
.def(py::init<>())
// getters
.def("getTimestamp", &ImgFrame::getTimestamp, DOC(dai, ImgFrame, getTimestamp))
.def("getTimestampDevice", &ImgFrame::getTimestampDevice, DOC(dai, ImgFrame, getTimestampDevice))
.def("getInstanceNum", &ImgFrame::getInstanceNum, DOC(dai, ImgFrame, getInstanceNum))
.def("getCategory", &ImgFrame::getCategory, DOC(dai, ImgFrame, getCategory))
.def("getSequenceNum", &ImgFrame::getSequenceNum, DOC(dai, ImgFrame, getSequenceNum))
Expand Down
9 changes: 4 additions & 5 deletions src/openvino/OpenVINOBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ void OpenVINOBindings::bind(pybind11::module& m){
;

// not strongly typed enum OpenVINO::Version
// previous step defined class 'OpenVINO' (variable 'openvino')
// previous step defined class 'OpenVINO' (variable 'openvino')
// which is used in defining the following enum (its scope)
// and that the values are available directly under OpenVINO.VERSION_2020_1, ...
// and that the values are available directly under OpenVINO.VERSION_2021_4, ...
// they are exported
// By default, pybind creates strong typed enums, eg: OpenVINO::Version::VERSION_2020_1
// By default, pybind creates strong typed enums, eg: OpenVINO::Version::VERSION_2021_4
py::enum_<OpenVINO::Version>(openvino, "Version", DOC(dai, OpenVINO, Version))
.value("VERSION_2020_1", OpenVINO::Version::VERSION_2020_1)
.value("VERSION_2020_2", OpenVINO::Version::VERSION_2020_2)
.value("VERSION_2020_3", OpenVINO::Version::VERSION_2020_3)
.value("VERSION_2020_4", OpenVINO::Version::VERSION_2020_4)
.value("VERSION_2021_1", OpenVINO::Version::VERSION_2021_1)
.value("VERSION_2021_2", OpenVINO::Version::VERSION_2021_2)
.value("VERSION_2021_3", OpenVINO::Version::VERSION_2021_3)
.value("VERSION_2021_4", OpenVINO::Version::VERSION_2021_4)
.export_values()
;

Expand Down