code: def get_image_transform_funcs(
      transform_types: Union[List[str], ListConfig, List[Callable]],
      size: int,
  ):
      """
      Parse a list of transform strings into callable objects.
  
      Parameters
      ----------
      transform_types
          A list of transforms, which can be strings or callable objects.
      size
          Image size.
  
      Returns
      -------
      A list of transform objects.
      """
      image_transforms = []
  
      if not transform_types:
          return image_transforms
  
      if isinstance(transform_types, ListConfig):
          transform_types = list(transform_types)
      elif not isinstance(transform_types, list):
          transform_types = [transform_types]
  
      if all(
          [
              isinstance(trans_type, str)
              for trans_type in transform_types
          ]
      ):
          pass
      elif all(
          [
              isinstance(trans_type, Callable)
              for trans_type in transform_types
          ]
      ):
          return copy.copy(transform_types)
      else:
          raise ValueError(
              f"transform_types {transform_types} contain neither all strings nor all callable objects."
          )
  
      for trans_type in transform_types:
          args = None
          kargs = None
          if "(" in trans_type:
              trans_mode = trans_type[0 : trans_type.find("(")]
              if "{" in trans_type:
                  kargs = ast.literal_eval(
                      trans_type[
                          trans_type.find("{") : trans_type.rfind(")")
                      ]
                  )
              else:
                  args = ast.literal_eval(
                      trans_type[trans_type.find("(") :]
                  )
          else:
              trans_mode = trans_type
  
          if trans_mode == "resize_to_square":
              image_transforms.append(
                  transforms.Resize((size, size), interpolation=BICUBIC)
              )
          elif trans_mode == "resize_gt_to_square":
              image_transforms.append(
                  transforms.Resize((size, size), interpolation=NEAREST)
              )
          elif trans_mode == "resize_shorter_side":
              image_transforms.append(
                  transforms.Resize(size, interpolation=BICUBIC)
              )
          elif trans_mode == "center_crop":
              image_transforms.append(transforms.CenterCrop(size))
          elif trans_mode == "random_resize_crop":
              image_transforms.append(
                  transforms.RandomResizedCrop(size)
              )
          elif trans_mode == "random_horizontal_flip":
              image_transforms.append(transforms.RandomHorizontalFlip())
          elif trans_mode == "random_vertical_flip":
              image_transforms.append(transforms.RandomVerticalFlip())
          elif trans_mode == "color_jitter":
              if kargs is not None:
                  image_transforms.append(
                      transforms.ColorJitter(**kargs)
                  )
              elif args is not None:
                  image_transforms.append(transforms.ColorJitter(*args))
              else:
                  image_transforms.append(
                      transforms.ColorJitter(
                          brightness=0.1, contrast=0.1, saturation=0.1
                      )
                  )
          elif trans_mode == "affine":
              if kargs is not None:
                  image_transforms.append(
                      transforms.RandomAffine(**kargs)
                  )
              elif args is not None:
                  image_transforms.append(
                      transforms.RandomAffine(*args)
                  )
              else:
                  image_transforms.append(
                      transforms.RandomAffine(
                          degrees=15,
                          translate=(0.1, 0.1),
                          scale=(0.9, 1.1),
                      )
                  )
          elif trans_mode == "randaug":
              if kargs is not None:
                  image_transforms.append(RandAugment(**kargs))
              elif args is not None:
                  image_transforms.append(RandAugment(*args))
              else:
                  image_transforms.append(RandAugment(2, 9))
          elif trans_mode == "trivial_augment":
              image_transforms.append(TrivialAugment(IMAGE, 30))
          else:
              raise ValueError(f"unknown transform type: {trans_mode}")
  
      return image_transforms
  
imports: import ast
  import codecs
  import copy
  import re
  import warnings
  from io import BytesIO
  from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union
  import numpy
  import pandas
  import PIL
  from omegaconf import ListConfig
  from text_unidecode import unidecode
  from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
  from tokenizers import pre_tokenizers
  from torchvision import transforms
  from ..constants import CLIP_IMAGE_MEAN, CLIP_IMAGE_STD, IDENTIFIER, IMAGE, IMAGE_BYTEARRAY, IMAGE_PATH, MMDET_IMAGE, MMLAB_MODELS
  from .collator import DictCollator
  from .preprocess_dataframe import MultiModalFeaturePreprocessor
  from .randaug import RandAugment
  from .trivial_augmenter import TrivialAugment
label_desc: Use image node_id 13 for calling a global function with example usage: get_image_transform_funcs(transform_types, size) and returns: image_transforms, image_transforms, copy