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:

  1. Single image.

  2. Folder with images. Images are getting rotated every 3 seconds. Example here.

  3. URL to a video/image.

  4. URL to a YouTube video.

  5. Path to depthai-recording.

  6. 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)
https://user-images.githubusercontent.com/18037362/193642506-76bd2d36-3ae8-4d0b-bbed-083a94463155.png

Live view pipeline uses live camera feeds (MonoCamera, ColorCamera) whereas Replaying pipeline uses XLinkIn nodes to which we send recorded frames.

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

cars-california-01

color.mp4

21.1 MB

Source video, useful for car detection / license plate recognition

cars-california-02

color.mp4

27.5 MB

Source video, useful for car detection / license plate recognition

cars-california-03

color.mp4

19 MB

Source video, useful for license plate recognition and bicylist detection

cars-tracking-above-01

color.mp4

30.8 MB

Source video, useful for car tracking/counting

depth-people-counting-01

left.mp4, right.mp4, calib.json

5.8 MB

Used by depth-people-counting demo

people-construction-vest-01

color.mp4

5.2 MB

Used by ObjectTracker example and pedestrian reidentification demo

people-images-01

5x jpg images

2 MB

Used by people-counting demo

people-tracking-above-01

color.mp4

3.2 MB

Fisheye top-down view, useful for people tracking/counting. Fast forward/downscaled

people-tracking-above-02

color.mp4

86.4 MB

Fisheye top-down view, useful for people tracking/counting

people-tracking-above-03

color.mp4

16.7 MB

Top-down view, used by people-tracker demo

people-tracking-above-04

color.mp4

5.3 MB

Top-down view at an angle, source video here

people-tracking-above-05

CAM_A.mp4, CAM_A.mp4, calib.json

12 MB (35sec)

Top-down view, left+right stereo cameras, demo usage at replay.py

Got questions?

Head over to Discussion Forum for technical support or any other questions you might have.