Replaying¶
OakCamera allows users to easily use depthai-recording instead of the live camera feed to run their pipelines. This feature will send recorded frames to the OAK device. This is useful especially during development, so we can record a complex scene only once and replay it many times to fine-tune the pipeline or AI models.
Because Recording saves calibration data and can save synchronized left+right mono streams so we can achieve full depth reconstruction.
from depthai_sdk import OakCamera
with OakCamera(recording='[PATH/URL/NAME]') as oak:
# Created CameraComponent/StereoComponent will use streams from the recording
camera = oak.create_camera('color')
Replaying support¶
Replaying feature is quite extensible, and supports a variety of different inputs:
Single image.
Folder with images. Images are getting rotated every 3 seconds. Example here.
URL to a video/image.
URL to a YouTube video.
Path to depthai-recording.
A name of a public depthai-recording.
Replaying a depthai-recording¶
When constructing the OakCamera object we can easily replay an existing depthai-recording, which results in using XLinkIn nodes instead of ColorCamera / MonoCamera nodes.
Script below will also do depth reconstruction and will display 3D detections coordinates (XYZ) to the frame.
from depthai_sdk import OakCamera
- with OakCamera() as oak:
+ with OakCamera(replay='path/to/folders') as oak:
color = oak.create_camera('color')
nn = oak.create_nn('mobilenet-ssd', color, spatial=True)
oak.visualize(nn.out.main, fps=True)
oak.start(blocking=True)
Public depthai-recordings¶
We host several depthai-recordings on our servers that you can easily use in your
application, e.g., OakCamera(recording='cars-california-01')
. Recording will get downloaded & cached on the computer for future use.
The following table lists all available recordings:
Name |
Files |
Size |
Notice |
---|---|---|---|
|
|
21.1 MB |
Source video, useful for car detection / license plate recognition |
|
|
27.5 MB |
Source video, useful for car detection / license plate recognition |
|
|
19 MB |
Source video, useful for license plate recognition and bicylist detection |
|
|
30.8 MB |
Source video, useful for car tracking/counting |
|
|
5.8 MB |
Used by depth-people-counting demo |
|
|
5.2 MB |
Used by ObjectTracker example and pedestrian reidentification demo |
|
5x jpg images |
2 MB |
Used by people-counting demo |
|
|
3.2 MB |
Fisheye top-down view, useful for people tracking/counting. Fast forward/downscaled |
|
|
86.4 MB |
Fisheye top-down view, useful for people tracking/counting |
|
|
16.7 MB |
Top-down view, used by people-tracker demo |
|
|
5.3 MB |
Top-down view at an angle, source video here |
|
|
12 MB (35sec) |
Top-down view, left+right stereo cameras, demo usage at replay.py |