l5kit.dataset.agent module

class l5kit.dataset.agent.AgentDataset(cfg: dict, zarr_dataset: l5kit.data.zarr_dataset.ChunkedDataset, rasterizer: l5kit.rasterization.rasterizer.Rasterizer, perturbation: Optional[l5kit.kinematic.perturbation.Perturbation] = None, agents_mask: Optional[numpy.ndarray] = None, min_frame_history: int = 10, min_frame_future: int = 1)

Bases: Generic[torch.utils.data.dataset.T_co]

get_frame_indices(frame_idx: int) numpy.ndarray

Get indices for the given frame. Here __getitem__ iterate over valid agents indices. This means __getitem__(0) matches the first valid agent in the dataset. :param frame_idx: index of the scene :type frame_idx: int

Returns

indices that can be used for indexing with __getitem__

Return type

np.ndarray

get_scene_dataset(scene_index: int) l5kit.dataset.agent.AgentDataset

Differs from parent only in the return type. Instead of doing everything from scratch, we rely on super call and fix the agents_mask

get_scene_indices(scene_idx: int) numpy.ndarray

Get indices for the given scene. Here __getitem__ iterate over valid agents indices. This means __getitem__(0) matches the first valid agent in the dataset. :param scene_idx: index of the scene :type scene_idx: int

Returns

indices that can be used for indexing with __getitem__

Return type

np.ndarray

load_agents_mask() numpy.ndarray

Loads a boolean mask of the agent availability stored into the zarr. Performs some sanity check against cfg. Returns: a boolean mask of the same length of the dataset agents