Skip to content

Instantly share code, notes, and snippets.

@naxty
Created August 15, 2019 15:32
Show Gist options
  • Save naxty/d5e2bf5323b54ea6b4e002602e35f0e2 to your computer and use it in GitHub Desktop.
Save naxty/d5e2bf5323b54ea6b4e002602e35f0e2 to your computer and use it in GitHub Desktop.
Keras to Core ML export
import coremltools
model = coremltools.converters.keras.convert(
model.h5',
input_names=['image'],
output_names=['output'],
class_labels=["0", "1"],
image_input_names='image',
red_bias = -1,
green_bias = -1,
blue_bias = -1,
image_scale = 1.0/127.5
)
model.save(“model.mlmodel”)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment