SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Implement Image Classification Using a Trained Core ML Model and Vision Framework

Import a trained Core ML model and use the Vision framework to prepare a certain image for the classification, then use the classification result to fetch products of a certain product category from the sample data service.

Overview

You will learn

  • ✔How to import a trained Core ML model into Xcode
  • ✔How to use the Vision framework to process an Image and feed it to the classification model
  • ✔How to take the classification result and fetch products for the classified product category
Kevin Muessig K Kevin Muessig January 9, 2023
Created on January 9, 2023
Contributors

More from Kevin Muessig

See all 13 tutorials by Kevin Muessig →

Prerequisites

  • Development environment: Apple Mac running macOS Catalina or higher with Xcode 12 or higher
  • SAP BTP SDK for iOS: Version 6.0

Steps

Details

You will learn

  • How to import a trained Core ML model into Xcode
  • How to use the Vision framework to process an Image and feed it to the classification model
  • How to take the classification result and fetch products for the classified product category

Step 1 Understand the Core ML model
—

For this tutorial you will import the ProductImageClassifier.mlmodel Core ML model into your Xcode project. The goal for this tutorial is to later feed an image of a MacBook as well as an image of an office chair to the model. The Core ML model should classify those two images the correct way and your app will load similar products from the data service and display them in a Table View.

Step 2 Import Core ML model
+
Step 3 Set up Product Classification Table View Controller for data loading
+
Step 4 Classify the input image
+
Step 5 Implement the Table Views Data Source methods
+
Step 6 Run app and classify some products
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 6
1. Understand the Core ML model 2. Import Core ML model 3. Set up Product Classification Table View Controller for data loading 4. Classify the input image 5. Implement the Table Views Data Source methods 6. Run app and classify some products