code: def __init__(self, config, *args, **kwargs):
      transform_params = config.transforms
      assert OmegaConf.is_dict(transform_params) or OmegaConf.is_list(
          transform_params
      )
      if OmegaConf.is_dict(transform_params):
          transform_params = [transform_params]
  
      transforms_list = []
  
      for param in transform_params:
          if OmegaConf.is_dict(param):
              # This will throw config error if missing
              transform_type = param.type
              transform_param = param.get(
                  "params", OmegaConf.create({})
              )
          else:
              assert isinstance(param, str), (
                  "Each transform should either be str or dict containing "
                  + "type and params"
              )
              transform_type = param
              transform_param = OmegaConf.create([])
  
          transform = getattr(transforms, transform_type, None)
          if transform is None:
              from mmf.utils.env import setup_torchaudio
  
              setup_torchaudio()
              from torchaudio import transforms as torchaudio_transforms
  
              transform = getattr(
                  torchaudio_transforms, transform_type, None
              )
          # If torchvision or torchaudiodoesn't contain this, check our registry
          # if we implemented a custom transform as processor
          if transform is None:
              transform = registry.get_processor_class(transform_type)
          assert transform is not None, (
              f"transform {transform_type} is not present in torchvision, "
              + "torchaudio or processor registry"
          )
  
          # https://github.com/omry/omegaconf/issues/248
          transform_param = OmegaConf.to_container(transform_param)
          # If a dict, it will be passed as **kwargs, else a list is *args
          if isinstance(transform_param, collections.abc.Mapping):
              transform_object = transform(**transform_param)
          else:
              transform_object = transform(*transform_param)
  
          transforms_list.append(transform_object)
  
      self.transform = transforms.Compose(transforms_list)
  
imports: import collections
  import math
  import random
  import warnings
  import torch
  from mmf.common.constants import INCEPTION_IMAGE_NORMALIZE
  from mmf.common.registry import registry
  from mmf.datasets.processors.processors import BaseProcessor
  from omegaconf import OmegaConf
  from torchvision import transforms
  from torchvision.transforms import Compose, Normalize, Resize, ToTensor
label_desc: Use image node_id 1 to create a new TorchvisionTransforms object from inherited base classes: BaseProcessor with example: obj = TorchvisionTransforms(config)