code: def __init__(
      self,
      *,
      base_size,
      mean=(0.485, 0.456, 0.406),
      std=(0.229, 0.224, 0.225),
      backend="pil",
      use_v2=False,
  ):
      T, _, _ = get_modules(use_v2)
  
      transforms = []
      backend = backend.lower()
      if backend == "tensor":
          transforms += [T.PILToTensor()]
      elif backend == "tv_tensor":
          transforms += [T.ToImage()]
      elif backend != "pil":
          raise ValueError(
              f"backend can be 'tv_tensor', 'tensor' or 'pil', but got {backend}"
          )
  
      if use_v2:
          transforms += [T.Resize(size=(base_size, base_size))]
      else:
          transforms += [
              T.RandomResize(min_size=base_size, max_size=base_size)
          ]
  
      if backend == "pil":
          # Note: we could just convert to pure tensors even in v2?
          transforms += [T.ToImage() if use_v2 else T.PILToTensor()]
  
      transforms += [
          T.ToDtype(torch.float, scale=True),
          T.Normalize(mean=mean, std=std),
      ]
      if use_v2:
          transforms += [T.ToPureTensor()]
  
      self.transforms = T.Compose(transforms)
  
file_path: vision/references/segmentation/presets.py
imports: import torch
label_desc: Use image node_id 1 to create a new SegmentationPresetEval object  with example: obj = SegmentationPresetEval()