Converting the Keras model into the Core ML model

Now that the Keras model has been created, the next step is to convert the Keras model into the Core ML model. For the first argument, use the filename of the newest .h5 file in the notebook folder:

output_labels = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
coreml_mnist = coremltools.converters.keras.convert(
'best_model.10-0.04.h5', input_names=['image'], output_names=['output'], class_labels=output_labels, image_input_names='image')
coreml_mnist.save("minsit_classifier.mlmodel")

Once you successfully run the code, you will find the minsit_classifer.mlmodel file created in your directory. We are going to use this to create an iOS mobile application to detect the digits.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset