Running a fastai model in iOS using CoreML

I recently wrote an article about running a fastai model in the browser. Today, I am sharing my next end-to-end example that trains a fastai vision classifier model, exports to CoreML (via ONNX) and build a react-native app around it. I hope you enjoy!

See my article about it here.

The code and notebook can be found in this repo: https://github.com/davidpfahler/react-native-ml-app

I’m looking forward to your feedback and suggestions.

16 Likes

This is super useful.

Just one question. Why react native. Why not native iOS app?

This is amazing work! I am also planning to use my fastai unet model on the server. Any thoughts on how run them on Java based servers? ONNX looks like only supports CLang based runtimes.

Hi

davidpfahler
Great work!

mrfabulous1 :grinning::grinning:

Works great @davidpfahler. Thank you for sharing this.
I tried the conversion with a ResNet-50 and a MobileNetV2.

I prepared a Colab to convert fastai models to CoreML. I used it for exporting CycleGan generator.
First we convert to Onnx and then to CoreML.
Link to Github

3 Likes