code: def get_img_size_from_data(
      data: Union[PIL.Image.Image, np.ndarray]
  ) -> ImgSize:
      """
      Returns image size.
      If the data is a numpy array, it is expected to be in the format (h,w) or (h,w,c).
      """
      assert isinstance(data, (PIL.Image.Image, np.ndarray))
  
      if isinstance(data, PIL.Image.Image):
          width, height = data.size
      else:
          height, width, *_ = data.shape
  
      return ImgSize(width=width, height=height)
  
file_path: icevision/icevision/utils/imageio.py
imports: from icevision.imports import *
  from PIL import ExifTags
label_desc: Use image node_id 10 for calling a global function with example usage: get_img_size_from_data(data) and returns: ImgSize