Skip to content

Instantly share code, notes, and snippets.

@anupamchugh
Created November 6, 2019 17:06
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 anupamchugh/a410eb258b73fbb15a820713e43f6b05 to your computer and use it in GitHub Desktop.
Save anupamchugh/a410eb258b73fbb15a820713e43f6b05 to your computer and use it in GitHub Desktop.
import coremltools
coreml_model = coremltools.converters.keras.convert('model.h5', input_names=['image'], output_names=['output'],
image_input_names='image')
coreml_model.author = 'Anupam Chugh'
coreml_model.short_description = 'Cat Dog Classifier converted from a Keras model'
coreml_model.input_description['image'] = 'Takes as input an image'
coreml_model.output_description['output'] = 'Prediction as cat or dog'
coreml_model.save('catdogcoreml.mlmodel')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment