DepthAI SDK is a Python package built on top of the depthai-python API library that improves ease of use when developing apps for OAK devices.
The OakCamera class abstracts DepthAI API pipeline building, different camera permutations, stream recording/replaying, adds debugging features, handles AI model sourcing and decoding, does message syncing & visualization, and much more.
Script below demonstrates how you can easily accomplish complex tasks, that would otherwise take 100s of lines of code, and a few hours of assembling code pieces together.
1from depthai_sdk import OakCamera, ResizeMode 2 3# Download a public depthai-recording and replay it 4with OakCamera(replay='cars-tracking-above-01') as oak: 5 # Create color camera 6 color = oak.create_camera('color') 7 8 # Download & run pretrained vehicle detection model and track detections 9 nn = oak.create_nn('vehicle-detection-0202', color, tracker=True) 10 nn.config_nn(resize_mode=ResizeMode.STRETCH) 11 12 # Visualize tracklets, show FPS 13 visualizer = oak.visualize(nn.out.tracker, fps=True) 14 visualizer.tracking(line_thickness=5).text(auto_scale=True) 15 16 # Start the app in blocking mode 17 oak.start(blocking=True)
A public video gets downloaded and frames are sent to the OAK camera. On the OAK camera, we run
which is an SDK supported model. Afterwards, we use object tracker for tracking these detections over
time. We visualize tracking results and configure visualizer to best fit our needs.
This class will be in alpha stage until depthai-sdk 2.0.0, so there will likely be some API changes.
To install this package, run the following command in your terminal window
python3 -m pip install depthai-sdk
We’re always happy to help with development or other questions you might have.