Performs Gaussian blur on image(s).
tfm.vision.augment.gaussian_filter2d(
image: tf.Tensor,
filter_shape: Union[List[int], Tuple[int, ...], int],
sigma: Union[List[float], Tuple[float], float] = 1.0,
padding: str = 'REFLECT',
constant_values: Union[int, tf.Tensor] = 0,
name: Optional[str] = None
) -> tf.Tensor
Args |
image
|
Either a 2-D Tensor of shape [height, width] , a 3-D Tensor of
shape [height, width, channels] , or a 4-D Tensor of shape
[batch_size, height, width, channels] .
|
filter_shape
|
An integer or tuple /list of 2 integers, specifying the
height and width of the 2-D gaussian filter. Can be a single integer to
specify the same value for all spatial dimensions.
|
sigma
|
A float or tuple /list of 2 floats, specifying the standard
deviation in x and y direction the 2-D gaussian filter. Can be a single
float to specify the same value for all spatial dimensions.
|
padding
|
A string , one of "REFLECT", "CONSTANT", or "SYMMETRIC". The type
of padding algorithm to use, which is compatible with mode argument in
tf.pad . For more details, please refer to
https://www.tensorflow.org/api_docs/python/tf/pad.
|
constant_values
|
A scalar , the pad value to use in "CONSTANT" padding
mode.
|
name
|
A name for this operation (optional).
|
Returns |
2-D, 3-D or 4-D Tensor of the same dtype as input.
|
Raises |
ValueError
|
If image is not 2, 3 or 4-dimensional,
if padding is other than "REFLECT", "CONSTANT" or "SYMMETRIC",
if filter_shape is invalid,
or if sigma is invalid.
|