parameters: (path, colorspace="auto")
return_statement: return ((torch.FloatTensor(img.getdata())).reshape(*img.size, -1) / 255.).permute(2, 0, 1)
docstring: From https://graphics.pixar.com/usd/release/wp_usdpreviewsurface.html
          `colorspace`: Flag indicating the color space in which the source texture is encoded. Possible Values:
              raw : Use texture data as it was read from the texture and do not mark it as using a specific color space.
              sRGB : Mark texture as sRGB when reading.
              auto : Check for gamma/color space metadata in the texture file itself; if metadata is indicative of sRGB,
                  mark texture as sRGB . If no relevant metadata is found, mark texture as sRGB if it is either 8-bit and
                  has 3 channels or if it is 8-bit and has 4 channels. Otherwise, do not mark texture as sRGB and use
                  texture data as it was read from the texture.
function: def _read_image(path, colorspace="auto"):
          """
  
          From https://graphics.pixar.com/usd/release/wp_usdpreviewsurface.html
          `colorspace`: Flag indicating the color space in which the source texture is encoded. Possible Values:
              raw : Use texture data as it was read from the texture and do not mark it as using a specific color space.
              sRGB : Mark texture as sRGB when reading.
              auto : Check for gamma/color space metadata in the texture file itself; if metadata is indicative of sRGB,
                  mark texture as sRGB . If no relevant metadata is found, mark texture as sRGB if it is either 8-bit and
                  has 3 channels or if it is 8-bit and has 4 channels. Otherwise, do not mark texture as sRGB and use
                  texture data as it was read from the texture.
  
  
          """
          if colorspace.lower() not in ['auto', 'srgb', 'raw']:
              raise MaterialLoadError(f'Colorspace {colorspace} is not supported. Valid values are [auto, sRGB, raw]')
          if not os.path.exists(path):
              raise MaterialLoadError(f'No such image file: `{path}`')
  
          img = Image.open(str(path))
          return ((torch.FloatTensor(img.getdata())).reshape(*img.size, -1) / 255.).permute(2, 0, 1)
function_tokens: def _read_image ( path , colorspace = "auto" ) : if colorspace . lower ( ) not in [ 'auto' , 'srgb' , 'raw' ] : raise MaterialLoadError ( f'Colorspace {colorspace} is not supported. Valid values are [auto, sRGB, raw]' ) if not os . path . exists ( path ) : raise MaterialLoadError ( f'No such image file: `{path}`' ) img = Image . open ( str ( path ) ) return ( ( torch . FloatTensor ( img . getdata ( ) ) ) . reshape ( * img . size , - 1 ) / 255. ) . permute ( 2 , 0 , 1 )