l5kit.geometry.voxel module¶
- l5kit.geometry.voxel.normalize_intensity(x: numpy.ndarray, max_intensity: float) numpy.ndarray ¶
Normalize (divide by max) and clip intensity values to fall between 0 and 1.
- Parameters
x (np.npdarray) – numpy array of any shape
max_intensity (float) – Maximum intensity value (anything above this will become 1)
- Returns
np.ndarray – array of same type and shape as x with values between 0 and 1 only
- l5kit.geometry.voxel.points_within_bounds(coords: numpy.ndarray, shape: Union[Collection[int], numpy.ndarray]) numpy.ndarray ¶
- Parameters
coords (np.ndarray) – (N,3)-shaped array containing points.
shape (tuple of ints or np.ndarray) – shape to use as bounds, should be length 3
- Returns
Binary mask for given coords array which is True for points that fall within the bounds of shape.
- l5kit.geometry.voxel.voxel_coords_to_intensity_grid(voxel_coords: numpy.ndarray, shape: tuple, dtype: numpy.dtype = <class 'numpy.float32'>, drop_out_of_bounds: bool = True) numpy.ndarray ¶
Puts coords into a grid: for each grid cell the number of points is written there.
- Parameters
voxel_coords (np.ndarray) – input array with coords (N,3) in intensity grid
shape (tuple of ints) – intensity grid shape
- Keyword Arguments
dtype (data-type) – data type for the intensity grid (default: {np.float32})
drop_out_of_bounds (bool) – [description] (default: {True})
- Returns
np.ndarray – Array with given shape, the value of each cell is the amount of coords for that point.