-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripting support (Python 3.9) #316
Conversation
…to gen2_scripting
# Conflicts: # depthai-core # examples/CMakeLists.txt # src/pipeline/NodeBindings.cpp
examples/script_camera_control.py
Outdated
img = device.getOutputQueue("still").get() | ||
cv2.imshow('still', img.getCvFrame()) | ||
if cv2.waitKey(1) == ord('q'): | ||
exit(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break
instead exit
so it's consistent with the rest of the examples
.def("addLogCallback", &Device::addLogCallback, py::arg("callback"), DOC(dai, Device, addLogCallback)) | ||
.def("removeLogCallback", &Device::removeLogCallback, py::arg("callbackId"), DOC(dai, Device, removeLogCallback)) | ||
; | ||
.def("setLogLevel", [](Device& d, LogLevel l) { py::gil_scoped_release release; d.setLogLevel(l); }, py::arg("level"), DOC(dai, Device, setLogLevel)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why py::gil_scoped_release
necessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all actually do, will fix. For others, its because those do blocking IO underneath, which can take "a while" -in the meantime other Python code can be executed.
TODO: Update |
Related PR: luxonis/depthai-core#180
Adds device side support for scripting along with:
pipeline.create(dai.node.[Node])
)