Building the iOS application

We will create a new iOS application and import the ML model into it:

Once you select the .mlmodel file you will see the details about it and the important ones are ML model Type, Inputs, and Outputs. The Inputs type should be image because our input is going to be images of food item.

Once we have imported the model, we have to load the model into memory:

 do { /* Use the Swift class `MobileNet` Core ML generates from the model. To use a different Core ML classifier model, add it to the project and replace `MobileNet` with that model's generated Swift class. */ let model = try VNCoreMLModel(for: food_graph().model) ...

Get Machine Learning Projects for Mobile Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.