def preprocess_image(image_path): """ Loads an image into a Numpy array Args: image_path: Path or file object. Returns: Numpy array """ logging.debug('Processing: %s', image_path) img = crop2square(image.load_img(image_path)).resize((224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = deepseenet_risk_factor.preprocess_input(x) return x
def preprocess_image(image_path): img = crop2square(image.load_img(image_path)).resize((224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = deepseenet_risk_factor.preprocess_input(x) return x