anomalib.data.utils.generators.perlin¶
Helper functions for generating Perlin noise.
Module Contents¶
Functions¶
|
Helper function. |
|
Generate Perlin noise parameterized by the octaves method. Numpy version. |
|
Fractal perlin noise. |
|
Returns a random 2d perlin noise array. |
|
Generate a random image containing Perlin noise. Numpy version. |
|
Generate a random image containing Perlin noise. PyTorch version. |
|
Generate Perlin noise parameterized by the octaves method. PyTorch version. |
- anomalib.data.utils.generators.perlin.rand_perlin_2d_octaves_np(shape, res, octaves=1, persistence=0.5)[source]¶
Generate Perlin noise parameterized by the octaves method. Numpy version.
- anomalib.data.utils.generators.perlin.generate_perlin_noise_2d(shape, res)[source]¶
Fractal perlin noise.
- anomalib.data.utils.generators.perlin.random_2d_perlin(shape: Tuple, res: Tuple[Union[int, torch.Tensor], Union[int, torch.Tensor]], fade=lambda t: ...) Union[numpy.ndarray, torch.Tensor][source]¶
Returns a random 2d perlin noise array.
- Parameters
shape (Tuple) – Shape of the 2d map.
res (Tuple[Union[int, Tensor]]) – Tuple of scales for perlin noise for height and width dimension.
fade (_type_, optional) – Function used for fading the resulting 2d map. Defaults to equation 6*t**5-15*t**4+10*t**3.
- Returns
Random 2d-array/tensor generated using perlin noise.
- Return type
Union[np.ndarray, Tensor]
- anomalib.data.utils.generators.perlin._rand_perlin_2d_np(shape, res, fade=lambda t: ...)[source]¶
Generate a random image containing Perlin noise. Numpy version.