l5kit.environment.utils module

class l5kit.environment.utils.KinematicActionRescaleParams(steer_scale: float, acc_scale: float)

Bases: tuple

Defines the parameters to rescale actions into un-normalized action space when the kinematic model is used.

Parameters
  • steer_scale – the scaling of the steer (kinematic model)

  • acc_scale – the scaling of the acceleration (kinematic model)

acc_scale: float

Alias for field number 1

steer_scale: float

Alias for field number 0

class l5kit.environment.utils.NonKinematicActionRescaleParams(x_mu: float, x_scale: float, y_mu: float, y_scale: float, yaw_mu: float, yaw_scale: float)

Bases: tuple

Defines the parameters to rescale actions into un-normalized action space when the kinematic model is not used.

Parameters
  • x_mu – the translation of the x-coordinate

  • x_scale – the scaling of the x-coordinate

  • y_mu – the translation of the y-coordinate

  • y_scale – the scaling of the y-coordinate

  • yaw_mu – the translation of the yaw (radians)

  • yaw_scale – the scaling of the yaw (radians)

x_mu: float

Alias for field number 0

x_scale: float

Alias for field number 1

y_mu: float

Alias for field number 2

y_scale: float

Alias for field number 3

yaw_mu: float

Alias for field number 4

yaw_scale: float

Alias for field number 5

l5kit.environment.utils.calculate_non_kinematic_rescale_params(sim_dataset: l5kit.simulation.dataset.SimulationDataset) l5kit.environment.utils.NonKinematicActionRescaleParams

Calculate the action un-normalization parameters from the simulation dataset for non-kinematic model.

Parameters

sim_dataset – the input dataset to calculate the action rescale parameters

Returns

the unnormalized action

l5kit.environment.utils.save_input_raster(rasterizer: l5kit.rasterization.rasterizer.Rasterizer, image: torch.Tensor, num_images: int = 20, output_folder: str = 'raster_inputs') None

Save the input raster image.

Parameters
  • rasterizer – the rasterizer

  • image – numpy array

  • num_images – number of images to save

  • output_folder – directory to save the image

Returns

the numpy dict with ‘positions’ and ‘yaws’