class_docstr: A dataset of images with data augmentation.
  
  .. note ::
      requires `torchvision` to be installed.
docstr: Initialize the dataset.
  
  :param images: the images, either as (relative) path, or preprocessed tensors.
  :param transforms:
      a sequence of transformations to apply to the images,
      cf. :module:`torchvision.transforms`
  :param root:
      the root directory for images
docstr_tok: ["Initialize","the","dataset",".",":","param","images",":","the","images",",","either","as","(","relative",")","path",",","or","preprocessed","tensors",".",":","param","transforms",":","a","sequence","of","transformations","to","apply","to","the","images",",","cf",".",":","module",":","`","torchvision.transforms","`",":","param","root",":","the","root","directory","for","images"]
code: def __init__(
      self,
      images: Sequence[Union[str, pathlib.Path, torch.Tensor]],
      transforms: Optional[Sequence] = None,
      root: Optional[pathlib.Path] = None,
  ) -> None:
      """
      Initialize the dataset.
  
      :param images: the images, either as (relative) path, or preprocessed tensors.
      :param transforms:
          a sequence of transformations to apply to the images,
          cf. :module:`torchvision.transforms`
      :param root:
          the root directory for images
      """
      _ensure_vision(self, vision_transforms)
      super().__init__()
      if root is None:
          root = pathlib.Path.cwd()
      self.root = pathlib.Path(root)
  
      self.images = images
      if transforms is None:
          transforms = [
              vision_transforms.RandomResizedCrop(size=224),
              vision_transforms.ToTensor(),
          ]
      transforms = list(transforms)
      transforms.append(
          vision_transforms.ConvertImageDtype(torch.get_default_dtype())
      )
      self.transforms = vision_transforms.Compose(transforms=transforms)
  
imports: import functools
  import pathlib
  from typing import Any, Callable, Optional, Sequence, Union
  import torch
  import torch.nn
  import torch.utils.data
  from class_resolver import OptionalKwargs
  from docdata import parse_docdata
  from .representation import BackfillRepresentation, Representation
  from .utils import ShapeError, WikidataCache
  from ..datasets import Dataset
  from ..triples import TriplesFactory
  from ..typing import OneOrSequence
label_desc: Use image node_id 1 to create a new VisionDataset object from inherited base classes: torch.utils.data with example: obj = VisionDataset(images, transforms, root)