We are thrilled to announce the latest release of our DepthAl SDK, packed with a range of enhancements and new features. In this blog post, we will walk you through the noteworthy updates included in this release, enabling you to harness the power of our SDK more effectively.
Trigger-Action Mechanism
Trigger-Action API in the DepthAl SDK offers a simple yet powerful way to specify certain conditions and actions that should be executed when those conditions are met. With this feature, you can easily define a set of rules that determine what actions should be taken based on specific conditions. While the SDK provides a range of pre-defined conditions and actions, you also have the flexibility to create your own customized rules. This empowers you to automate processes and streamline workflows according to your unique requirements.
The following example illustrates how to save a 15-second video when at least one person is detected:
from depthai_sdk import OakCamera
from depthai_sdk.trigger_action.actions.record_action import RecordAction
from depthai_sdk.trigger_action.triggers.detection_trigger import DetectionTrigger
with OakCamera() as oak:
color = oak.create_camera('color', encode='jpeg')
stereo = oak.create_stereo('400p')
nn = oak.create_nn('mobilenet-ssd', color)
trigger = DetectionTrigger(input=nn, min_detections={'person': 1}, cooldown=30)
action = RecordAction(inputs=[color, stereo.out.disparity], dir_path='./recordings/',
duration_before_trigger=5, duration_after_trigger=10)
oak.trigger_action(trigger=trigger, action=action)
oak.visualize(nn)
oak.start(blocking=True)
You can find more examples on our GitHub.
Infinite replay
The new replay looping option has been added to our SDK. This feature enables you to effortlessly loop through recorded data, making the development process more convenient.
The following example shows how to use this feature:
from depthai_sdk import OakCamera
with OakCamera(replay='cars-california-02') as oak:
oak.replay.set_loop(True) # Loop the video, otherwise app will exit when video ends
color = oak.create_camera('color', '1080p')
nn = oak.create_nn('vehicle-detection-adas-0002', input=color)
oak.visualize(nn)
oak.start(blocking=True)
Updated documentation
We have updated our documentation page to provide more comprehensive and accessible information. We aim to make it easier for you to understand and utilize the features and functionalities of DepthAI SDK.
Visit our updated documentation page at DepthAl SDK docs and explore the wealth of information we have prepared for you!
To view the complete list of changes, please visit GitHub release page. We value your feedback and encourage you to share your experiences. suggestions, and ideas with our community. Together, we can continue to improve and evolve DepthAI SDK library to meet the ever-growing demands!