SAP Leonardo Machine Learning Trial

After all the buzz about SAP Leonardo last week at Sapphire, I thought I would take the new Machine Learning micro services for a spin. ...

Contact us

After all the buzz about SAP Leonardo last week at Sapphire, I thought I would take the new Machine Learning micro services for a spin.

If you navigate through the Leonardo page for ML, you will get a link to the API Hub, where you can see the available functional services:

  • Time Series Changepoint Detection
  • Document Feature Extraction
  • Image Classification
  • Image Feature Extraction
  • Product Image Classification
  • Product Text Classification
  • Similarity Scoring
  • Time Series Forecast
  • Topic Detection
  • Translation

Image Classification seems like an easy enough first trial.

If you click on that and review the overview tab, it says somewhat briefly:

Image Classification API calculates and returns a list of classifications along with their probabilities for a given image.

Clicking on the resource tab, you can review the operations. The only one here is POST. If you are logged in, you can simply go to the input parameters and try it out by choosing a file!

Let’s see if it can match my Golden Doodle, Chloey?

Return

{
"_id": "9101f024-5c75-4d23-9207-8644775a2610",
"predictions": [
{
"name": "chloey2.png",
"results": [
{
"label": "Bouvier des Flandres",
"score": 0.340883
},
{
"label": "Irish water spaniel",
"score": 0.189743
},
{
"label": "miniature poodle",
"score": 0.142425
},
{
"label": "standard poodle",
"score": 0.094428
},
{
"label": "Kerry blue terrier",
"score": 0.085941
}
]
}
],
"processed_time": "Fri, 26 May 2017 20:21:35 GMT",
"request": {
"files": [
"chloey2.png"
],
"options": {},
"tenantName": "imgclassif-tech-user",
"texts": []
},
"status": "DONE",
"tenantName": "imgclassif-tech-user"
}

Nice! I had to Google ‘Bouvier des Flandres’, but it is a near match. Water Spaniels and Poodles are also very close.

You can also click on the Generate Code button, and choose code snippets in Javascript, Java, Swift (for the new Apple SDK Partnership), Curl, or ABAP.

We’ll use the Swift snippet, and in V.2 of this blog, we’ll combine with the iOS SDK for SCP and take photos in an app and do automatic matches on them.

But a logical next step is to get the API Key and try this out from POSTman (a REST test tool).

Go ahead and use the code snippet details to know what to put into POSTman. I create a POST request, se the Accept Header, and insert the APIKey.

You can get an API Key here:

Switch over to the body tab and input ‘files’ param like this:

Finally — click send and you will see your results!

Wow, seems to work! I’ll try a few more and report back.

Gavin Quinn

Gavin Quinn

Gavin Quinn is an industry thought leader and has a relentless commitment to making the SAP user experience simple, mobile, and beautiful. Gavin is the founder and chief architect of Mindset Consulting and has over 15 years of experience leading SAP projects for Fortune 1000 companies, internationally-renowned health care organizations, and government agencies. He got his start in UX design with SAP NetWeaver Portal and has quickly evolved to include mobile design using SAP Fiori and other web-friendly technologies. Most recently, his focus has been SAP ERP, SAP HANA, and SAP Fiori. Gavin is a regular blogger and speaker on the topics of mobility and SAP Fiori.

Let’s make your SAP better, together.

  • This field is for validation purposes and should be left unchanged.