code: def image_size_from_opts(opts) -> Tuple[int, int]:
      try:
          sampler_name = getattr(
              opts, "sampler.name", "variable_batch_sampler"
          ).lower()
          if sampler_name.find("var") > -1:
              im_w = getattr(
                  opts,
                  "sampler.vbs.crop_size_width",
                  DEFAULT_IMAGE_WIDTH,
              )
              im_h = getattr(
                  opts,
                  "sampler.vbs.crop_size_height",
                  DEFAULT_IMAGE_HEIGHT,
              )
          elif sampler_name.find("multi") > -1:
              im_w = getattr(
                  opts,
                  "sampler.msc.crop_size_width",
                  DEFAULT_IMAGE_WIDTH,
              )
              im_h = getattr(
                  opts,
                  "sampler.msc.crop_size_height",
                  DEFAULT_IMAGE_HEIGHT,
              )
          else:
              im_w = getattr(
                  opts,
                  "sampler.bs.crop_size_width",
                  DEFAULT_IMAGE_WIDTH,
              )
              im_h = getattr(
                  opts,
                  "sampler.bs.crop_size_height",
                  DEFAULT_IMAGE_HEIGHT,
              )
      except Exception as e:
          im_h = DEFAULT_IMAGE_HEIGHT
          im_w = DEFAULT_IMAGE_WIDTH
      return im_h, im_w
  
file_path: ml-cvnets/utils/tensor_utils.py
imports: from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from torch import distributed
  from common import DEFAULT_IMAGE_CHANNELS, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, DEFAULT_VIDEO_FRAMES
  from utils.third_party.ddp_functional_utils import all_gather
label_desc: Use image node_id 1 for calling a global function with example usage: image_size_from_opts(opts) and returns: im_h,  im_w