drscotthawley / panotti

A multi-channel neural network audio classifier using Keras
MIT License
270 stars 72 forks source link

iOS implementation #43

Open eupston opened 6 years ago

eupston commented 6 years ago

Hi there,

First off thanks for the classification model! I was wondering if you had any ideas about how to implement this in swift? I believe I successfully converted the HDF5 to a MLmodel, but it wants to accept an MLmultiarray as input. Any ideas about how to convert an audio stream to such an array? Thanks in advance!

drscotthawley commented 6 years ago

Hi @eupston! I have no experience with an iOS implementation, but I'd be interested in finding out the answer if you figure it out!

scinfu commented 6 years ago

How did you converted HDF5 to MLmodel?

eupston commented 6 years ago

@scinfu this right here mate:

from keras.models import load_model import coremltools

coreml_model = coremltools.converters.keras.convert('weights.hdf5') coreml_model.save('MyModel.mlmodel')

you can include class labels as a parameter in the convert as well.