TiledBlurGenerator#
- class deepinv.physics.generator.TiledBlurGenerator(psf_generator, patch_size, stride=None, rng=None, device='cpu', **kwargs)[source]#
Bases:
TiledMixin2d,PSFGeneratorGenerates parameters of the
deepinv.physics.TiledSpaceVaryingBluroperator. The image is divided into overlapping patches, each local patch is convolved with a different PSF.This generates a dict with key
'filter', which is tensor of shape(B, C, K, psf_size, psf_size)whereKis the number of patches in which the image is divided. It is computed based on thepatch_size,strideand the givenimg_sizeduring thestep()function call.- Parameters:
psf_generator (deepinv.physics.generator.PSFGenerator) – A PSF generator, such as
motion blurordiffraction blur generator.patch_size (int | tuple[int, int]) – size of the patches (height, width) in which the image is divided.
stride (int | tuple[int, int]) – stride between adjacent patches (height, width). Defaults to
patch_size.
- step(batch_size=1, img_size=None, seed=None, **kwargs)[source]#
Generates a random set of filters for the tiled space-varying blur.
- Parameters:
- Returns:
a dictionary containing filters, with key:
filters: a tensor of shape(B, C, K, psf_size, psf_size), whereKis the number of patches in which the image is divided.
- Return type: