PatchDataset

class deepinv.datasets.PatchDataset(imgs, patch_size=6, stride=1, transforms=None, shapes=(-1,))[source]

Bases: Dataset

Builds the dataset of all patches from a tensor of images.

Parameters:
  • imgs (torch.Tensor) – Tensor of images, size: batch size x channels x height x width

  • patch_size (int) – size of patches

  • transforms (callable) – data augmentation. callable object, None for no augmentation.

  • shape (tuple) – shape of the returned tensor. None returns C x patch_size x patch_size. The default shape is (-1,).

Examples using PatchDataset:

Patch priors for limited-angle computed tomography

Patch priors for limited-angle computed tomography