I am using a Keras network that uses an input image of 128x128 pixels, this network got an accuracy of more than 85% on the chars74K dataset. When I converted this network to a CoreML model the results are always 100% certain but always wrong, never the correct letter. The code for my Keras network can be found here: https://github.com/thijsheijden/chars74kCNN
The code I used to convert to a CoreMLModel is the following:
import coremltools
import h5py
import pandas
coreml_model = coremltools.converters.keras.convert(
"chars74kV4.0.h5", class_labels = "class_labels.txt", image_input_names= ['input'], input_names=['input'])
coreml_model.author = 'Thijs van der Heijden'
coreml_model.license = 'MIT'
coreml_model.description = 'A basic Deep Convolutional Neural Network to classify handwritten letters.'
coreml_model.input_description['input'] = 'A 128x128 pixel Image'
coreml_model.save('chars74k.mlmodel')
The code for my IOS App can be found here: https://github.com/thijsheijden/Visionary
I would greatly appreciate any help as I am really stuck on this one! Thanks in advance!