l5kit.vectorization.vectorizer module

class l5kit.vectorization.vectorizer.Vectorizer(cfg: dict, mapAPI: l5kit.data.map_api.MapAPI)

Bases: object

Object that processes parts of an input frame, and converts this frame to a vectorized representation - which can e.g. be fed as input to a DNN using the corresponding input format.

vectorize(selected_track_id: Optional[int], agent_centroid_m: numpy.ndarray, agent_yaw_rad: float, agent_from_world: numpy.ndarray, history_frames: numpy.ndarray, history_agents: List[numpy.ndarray], history_tl_faces: List[numpy.ndarray], history_position_m: numpy.ndarray, history_yaws_rad: numpy.ndarray, history_availability: numpy.ndarray, future_frames: numpy.ndarray, future_agents: List[numpy.ndarray]) dict

Base function to execute a vectorization process.

  • selected_track_id – selected_track_id: Either None for AV, or the ID of an agent that you want to

  • of. (predict the future) –

  • states. (This agent is centered in the representation and the returned targets are derived from their future) –

  • agent_centroid_m – position of the target agent

  • agent_yaw_rad – yaw angle of the target agent

  • agent_from_world – inverted agent pose as 3x3 matrix

  • history_frames – historical frames of the target frame

  • history_agents – agents appearing in history_frames

  • history_tl_faces – traffic light faces in history frames

  • history_position_m – historical positions of target agent

  • history_yaws_rad – historical yaws of target agent

  • history_availability – availability mask of history frames

  • future_frames – future frames of the target frame

  • future_agents – agents in future_frames


a dict containing the vectorized frame representation

Return type