read_image#

txv.utils.read_image(image_path: str, mean: List = [0.5, 0.5, 0.5], stddev: Tuple = [0.5, 0.5, 0.5]) Tensor#

This function is a combination of resizing to 256, center cropping to 224, and normalizing the image.

Parameters:
  • image_path (str) – Path to the image file.

  • mean (List, optional) – Mean to normalize the image. The default is [0.5, 0.5, 0.5].

  • stddev (Tuple, optional) – Standard deviation to normalize the image. The default is [0.5, 0.5, 0.5].