Filters#
Implements filters used by models.
- class anomalib.models.components.filters.GaussianBlur2d(sigma, channels=1, kernel_size=None, normalize=True, border_type='reflect', padding='same')#
Bases:
ModuleCompute GaussianBlur in 2d.
Makes use of kornia functions, but most notably the kernel is not computed during the forward pass, and does not depend on the input size. As a caveat, the number of channels that are expected have to be provided during initialization.
- forward(input_tensor)#
Blur the input with the computed Gaussian.
- Parameters:
input_tensor (torch.Tensor) – Input tensor to be blurred.
- Returns:
Blurred output tensor.
- Return type:
Tensor