def load_img(path, grayscale=False, target_size=None):
img = io.imread(path, grayscale)<EOL>if target_size:<EOL><INDENT>img = transform.resize(img, target_size, preserve_range=True).astype('<STR_LIT>')<EOL><DEDENT>return img<EOL>
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.