l5kit.data.zarr_dataset module

class l5kit.data.zarr_dataset.ChunkedDataset(path: str, key: str = '')

Bases: object

ChunkedDataset is a dataset that lives on disk in compressed chunks, it has easy to use data loading and writing interfaces that involves making numpy-like slices. Currently only .zarr directory stores are supported (i.e. the data will live in a folder on your local filesystem called <something>.zarr).

get_scene_dataset(scene_index: int) l5kit.data.zarr_dataset.ChunkedDataset

Get a new ChunkedDataset of a single scene. This dataset lives in memory (as np.ndarray)

Parameters

scene_index – the scene index

Returns

a dataset with a single scene inside

initialize(mode: str = 'w', num_scenes: int = 0, num_frames: int = 0, num_agents: int = 0, num_tl_faces: int = 0) l5kit.data.zarr_dataset.ChunkedDataset

Initializes a new zarr dataset, creating the underlying arrays.

Parameters
  • mode – Mode to open dataset in, should be something that supports writing. (default: {“w”})

  • num_scenes – pre-allocate this number of scenes

  • num_frames – pre-allocate this number of frames

  • num_agents – pre-allocate this number of agents

  • num_tl_faces – pre-allocate this number of traffic lights

open(mode: str = 'r', cached: bool = True, cache_size_bytes: int = 1000000000) l5kit.data.zarr_dataset.ChunkedDataset

Opens a zarr dataset from disk from the path supplied in the constructor.

Parameters
  • mode – Mode to open dataset in, default to read-only (default: {“r”})

  • cached – Whether to cache files read from disk using a LRU cache. (default: {True})

  • cache_size_bytes – Size of cache in bytes (default: {1e9} (1GB))