Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Murali_Shanmu
Active Contributor
SAP Leonardo Machine Learning Foundational APIs have been recently made available in the trial landscape. Anyone can register for a trial account and test drive these ML APIs. In this blog, I want to quickly show you how you get started using the ML APIs to works with the pre-trained models. At SAPPHIRE, the Machine Learning team also announced a set of new pre-trained and customizable services for Face detection, Scene text recognition etc. In the blog, I would like to focus on Scene text recognition which will enable to read text from natural images/scenes. I have been working with several customers who were looking for a similar service to extract text/numbers from images.

I would also like to point to a blog series by f.lehmann  on “Getting started with SAP Leonard ML Foundation on SAP Cloud Platform Cloud Foundry”. Fabian has used a Productive account and shows how to get started as well as covers how to retrain the models and also deploy your own ML models. I would highly recommend going through those blogs.

When registering for a Cloud Foundry trial account, ensure you pick AWS instance as I couldn’t find ML services in Azure/GCP yet.

 



Once you have a Global Account in the Cloud Foundry trial landscape,  verify your entitlements.



You will notice ML Foundation Trial “Standard” service plan is already allocated to this account. Interesting to note that the Blockchain Hyperledger Fabric service is also provided for trial.



Navigate to the Spaces and click on the “Dev” space.



Under Service Marketplace, locate “ml-foundation-trial-beta”



Create a new Instance from the “Instances” menu.



Provide a name of your choice



 

Once the instance has been created, select the instance to go into the details



Create a Service Key form the “Service Keys” menu.



Provide a name of your choice for the service key.



This will give you list of parameters which you will need in order to interact with the ML APIs and build an application. There will be secret keys along with the API endpoints for each of the service. You would be able to test these APIs directly from SAP API Business Hub too.

 



I can test the OCR service by providing an image of a receipt. Below is a receipt which I had from a recent shopping.



I can use POSTMAN Rest Client to pass this image and it would be able to detect the store name, address and the total amount.



 

If you would like to test this using REST Client, please follow the instructions on the setup here - on “Getting started with SAP Leonard ML Foundation on SAP Cloud Platform Cloud Foundry”.

Here is a video which shows how one can build a native mobile app which leverages the above functionality. This android app was built by two interns from SAP Singapore office - Rahul Rajesh & Anusha Anandan in just few days.



I was also curious to find the accuracy of the Scene text ML service. Below is a simple image which shows the house number.



I was able to use the POSTMAN Rest client to test this service with the above image too.



I hope this blog was informative. Go ahead and try these ML APIs on your own and build apps leveraging them.
26 Comments
yogananda
Product and Topic Expert
Product and Topic Expert
That's really good info to get started
UxKjaer
Product and Topic Expert
Product and Topic Expert
muralidaran.shanmugham2 Legend as always. Good work mate!

 
alexandre_lara
Product and Topic Expert
Product and Topic Expert
Do you have the source code? This demo is amazing.
Yashpal
Active Contributor
0 Kudos
Hi Murali,

While creating its say the service is paid. can you comment.

 

Murali_Shanmu
Active Contributor
0 Kudos
You are on trial landscape. Please ignore the message.

 
kashif_bashir
Explorer
0 Kudos
Hi, Any idea where can i get "bearer" token?

I am getting authorization error while trying to post using REST Client.

 

Br,

Kashif

 

 
Murali_Shanmu
Active Contributor
0 Kudos
Hi Kashif,

If you would like to test this using REST Client, please follow the instructions on the setup here – on “Getting started with SAP Leonard ML Foundation on SAP Cloud Platform Cloud Foundry”.

 
kashif_bashir
Explorer
0 Kudos
Thanks Alot muralidaran.shanmugham2 .

Indeed another great article by yourself. Thanks for helping me out with seeing it working with POSTMAN. 😉

 

Br,

Kashif
Ravindra_T
Explorer
0 Kudos
Hi Murali,

Is OCR changed or same that was in API Hub. As we tried this last year and looking for some capabilities like support for .doc/.docx files and file size of >5 MB etc.....

 

Best Regards

Ravindra Tanguturi
Murali_Shanmu
Active Contributor
0 Kudos
Hi Ravindra,

OCR service (like any other service) has been going through lot of updates. The API Business Hub sandbox service instance only allows documents of up to 2MB, whereas productive instances up to 10MB. The service accepts pdf, jpg and png files types as input and returns detected texts within the file in either text or hOCR format. Hope this helps.

 
Former Member
0 Kudos
Thank you very much for the post, it has helped me a lot. I am interested in knowing how you do to get the image in good shape so that the service can extract the information well. How do you do this process? I see that when you take the photo the app recognizes you the receipt
sabarna17
Contributor
0 Kudos
Nice blog Murali.

I have a question regarding the APIs. Can we create our own APIs with different Machine learning Algorithm any where and access that from POSTMAN?
Murali_Shanmu
Active Contributor
0 Kudos
We need to ensure that the image provided to the ML model is of good quality.

 
Murali_Shanmu
Active Contributor
0 Kudos
Its very much possible. One of the key scenarios of the ML platform is to allow the deployment of custom models and expose them as APIs. Once you deploy your own models, you would use the training infrastructure to train the models

 
sabarna17
Contributor
0 Kudos
Thanks Murali for your input. Can you please provide come of the relative tutorials for same.
Saritha_K
Contributor
0 Kudos
Hi Murali,

Is it possible to share details on how the android app was developed?

Regards,

SK
Murali_Shanmu
Active Contributor
0 Kudos

Sorry, I don’t have access to the app to share the code. I will try and find out from the colleagues who built it

 

mzahid0071
Participant
0 Kudos
I am getting below error in Window :

{
“error”: {
“code”: “401”,
“message”: “Unable to authorize the request.: Token error: Access token was not prefixed with token type: Bearer”,
“requestId”: “76ffd57c-3737-4d61-7f0f-d0cd62a2fe66”
}
}

 

Any resolution to this ?

I am doing below steps

  1.  copying the image classifier url ( which i get from service key ) and POST it


This is my first time using postman, could you please explain me how to use

  1. Image classifier url ?

  2. I am able to get the oauth url - access token , now what is next ?

  3. In this blog ( https://blogs.sap.com/2018/01/29/getting-started-with-sap-leonard-ml-foundation-on-sap-cloud-platform-cloud-foundry/comment-page-1/#comment-443997) it is too fast to understand how to get the token and use image classifier .

0 Kudos

Hi Experts

Very nice posting! But having some trouble getting the token call to work in postman – i have setup the enviroment using the guide you linked to. can you confirm that for authentication on a trial CF instance i would have to use prefix ‘trial’? and the username is clientid and pass clientsecret?

I keep getting a "bad credentials" response when trying from postman.

Cheers Allan

0 Kudos
Sorry - my bad - got it. For trial url has to be:
https://<S-User>trial.authentication.eu10.hana.ondemand.com
mzahid0071
Participant
0 Kudos
Hi,

 

I am also facing the same issue.

This might be something with barrier on postman, which is not storing the Oath .

 
mzahid0071
Participant
0 Kudos

Dear experts,

 

Why ML application is no longer available in Europe Regions ? Please let me know which region I have to select?? I can see Blockchain applications but not Ml-Foundation .

 

Please suggest.

 

Thanks in advance.

UweFetzer_se38
Active Contributor
0 Kudos
No problem here:



(haven't tested whether the service works or not, just the availability)
mzahid0071
Participant
I found what mistake I have did

When I create a new space i did not assigned it to entitlement section .

 

This is now resolved.

 

Thanks you very much.
0 Kudos

Hi,

When I am using SCENE_TEXT_RECOGNITION_URL API .

Always getting error:

{
“error”: {
“code”: “400”,
“message”: “Invalid request: “,
“requestId”: “bd137753-e6aa-4001-6bf8-4779ccab872a”
}
}

 

But another API can work.

How can I solve it?

 

Best Regards,

Baron

0 Kudos
Why is no longer ml-foundation-trial-beta? cannot use it
Labels in this area