code: def load_img(path, grayscale=False, target_size=None):
      
      img = io.imread(path, grayscale)
      if target_size:
          img = transform.resize(img, target_size, preserve_range=True).astype('uint8')
      return img
docs: Utility function to load an image from disk.
  
      Args:
        path: The image file path.
        grayscale: True to convert to grayscale image (Default value = False)
        target_size: (w, h) to resize. (Default value = None)
  
      Returns:
          The loaded numpy image.