def load_image(path, image_size): image = Image.open(path).resize(image_size) x = np.asarray(image, dtype=np.float32) return VGG19.preprocess(x, input_type='RGB')
def preprocess_image(image, image_size, clip_rect=None): if clip_rect is not None: image = image.crop(clip_rect) image = image.resize(image_size, Image.BILINEAR) x = np.asarray(image, dtype=np.float32) return VGG19.preprocess(x, input_type='RGB')
def preprocess_image(image, image_size): image = image.resize(image_size, Image.BILINEAR) x = np.asarray(image, dtype=np.float32) return VGG19.preprocess(x, input_type='RGB')