Core ML: Introduction

  1. Upload a trained model to XCode
  2. Use it (instantiate it)
  3. Make predictions
// UIImage to CVPixelBuffer
guard let pixelBuffer = weakSelf.photo.pixelBuffer() else {
return
}

// Instantiate Modal
let mobileNet = MobileNet()

// Perform prediction
let prediction = try? mobileNet.prediction(image: pixelBuffer)

// Obtain prediction confidence for prediction category
let confidence = prediction?.classLabelProbs[prediction?.classLabel ?? ""]

A Software Engineer with a passion for technology. Working as an iOS Developer @BBC

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Google Debuts TensorFlow 2.0 Alpha

To Impute or not to Impute?

Noodles & Machine Learning

Build Realistic Human Speech Animations with the New VOCA Model and 4D Face Dataset

Getting the most of Machine Learning: 7 key points to build effective ML systems

GET STARTED WITH MACHINE LEARNING

From Ballerina to AI Researcher: Part I

Peeking Into the Black Box of Deep Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Melvin John

Melvin John

A Software Engineer with a passion for technology. Working as an iOS Developer @BBC

More from Medium

Cloud Native Buildpack Inside Out

Error Budget Is All You Need - Part 1

Istio — Service Mesh — Introduction

What Is Environment as a Service (EaaS) and Do You Need It?