Skip to content

Instantly share code, notes, and snippets.

@AMZzee
Created June 22, 2021 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AMZzee/37d6aab56ace4081d434ac31b40ff162 to your computer and use it in GitHub Desktop.
Save AMZzee/37d6aab56ace4081d434ac31b40ff162 to your computer and use it in GitHub Desktop.
def prepare_image(file):
img = image.load_img(img_path + file, target_size=(IMAGE_SIZE, IMAGE_SIZE))
img_array = image.img_to_array(img)
img_array_expanded_dims = np.expand_dims(img_array, axis=0)
return keras.applications.mobilenet.preprocess_input(img_array_expanded_dims)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment