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
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?
"label": "Bouvier des Flandres",
"label": "Irish water spaniel",
"label": "miniature poodle",
"label": "standard poodle",
"label": "Kerry blue terrier",
"processed_time": "Fri, 26 May 2017 20:21:35 GMT",
"texts":  },
Nice! I had to Google ‘Bouvier des Flandres’, but it is a near match. Water Spaniels and Poodles are also very close.
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.
View our LinkedIn, here.