def img(image_file): rgb = ndimage.imread(image_file).astype(float) rgb = (rgb - 255.0 / 2) / 255.0 return rgb