record_replay
ImageRecorder ¶
ImageRecorder(
camera_provider: CameraProvider, data_dir: Path
)
This module saves images from a CameraProvider to disk.
This module saves images from a CameraProvider to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
camera_provider
|
CameraProvider
|
the camera provider to record images from |
required |
data_dir
|
Path
|
the directory to save images to. Images are saved in subdirectories |
required |
set_recording ¶
set_recording(value: bool)
Enable or disable recording images from the camera provider.
ReplayCameraProvider ¶
ReplayCameraProvider(
replay_folder: Path, replay_interval: float = 0.01
)
Bases: CameraProvider[ReplayCamera]
This module collects and simulates cameras by looping over images in a drive.
NOTE: The first image of each camera will be emitted at any time before the timestamp of the second image. Therefore, setting the time to 0.0 will cause all cameras to emit their first image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
replay_folder
|
Path
|
path to the root replay folder containing the camera folders |
required |
replay_interval
|
float
|
the interval at which the provider checks for new images (in seconds) |
0.01
|
create_ui ¶
create_ui(
*,
skip_time: float = 2.0,
time_label_format: str = "%d.%m.%Y %H:%M:%S"
) -> None
Create a simple UI for controlling the replay.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_time
|
float
|
the amount of time to skip when pressing the skip buttons (in seconds) |
2.0
|
time_label_format
|
str
|
the format to be used for the current time label (used by |
'%d.%m.%Y %H:%M:%S'
|
jump_to ¶
jump_to(percent: float) -> None
Jump to a specific point in the replay.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
percent
|
float
|
a value between 0.0 and 100.0, where 0.0 is the start and 100.0 is the end |
required |
jump_to_time ¶
jump_to_time(time: float) -> None
Jump to a specific time in the replay.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
float
|
time in seconds |
required |
set_speed ¶
set_speed(speed: float) -> None
Set the playback speed.
1.0 is real-time, 2.0 is double speed, 0.5 is half speed. You may use negative values to play backwards.