code: def __init__(self, backend="pil", use_v2=False):
      T, _ = get_modules(use_v2)
      transforms = []
      backend = backend.lower()
      if backend == "pil":
          # Note: we could just convert to pure tensors even in v2?
          transforms += [T.ToImage() if use_v2 else T.PILToTensor()]
      elif backend == "tensor":
          transforms += [T.PILToTensor()]
      elif backend == "tv_tensor":
          transforms += [T.ToImage()]
      else:
          raise ValueError(
              f"backend can be 'tv_tensor', 'tensor' or 'pil', but got {backend}"
          )
  
      transforms += [T.ToDtype(torch.float, scale=True)]
  
      if use_v2:
          transforms += [T.ToPureTensor()]
  
      self.transforms = T.Compose(transforms)
  
file_path: vision/references/detection/presets.py
imports: from collections import defaultdict
  import torch
  import transforms
label_desc: Use image node_id 1 to create a new DetectionPresetEval object  with example: obj = DetectionPresetEval(backend, use_v2)