Developing a Smart Selfie App using SAP AppGyver
UPDATED FEBRUARY 2022
|Application Development Lobby for Low Code/No Code Development on SAP BTP
In my previous blog post, I showed how you can get started using SAP AppGyver along with links to tutorials & academy videos. I have also demonstrated an app connected to Cloud for Customer which was built using the free trial available on appgyver.com
In this blog post, I would like to share my experience on how you can access SAP AppGyver using the Application Lobby and build a Smart Selfie App.
Life insurance companies are always looking for new ways to engage and connect with people especially millennials. I recently came across a concept where few companies use AI powered app which can take a selfie and provide an instant life insurance quote to the user. With advancement in AI/ML technologies, it is now become easier to predict a person’s age, gender, and body mass index (BMI) based on a selfie photo. Applying AI based algorithms, the app can analyse facial wrinkles, sunspots, spectacles etc to get a picture of the person’s overall health.
For demonstration, I am leveraging Azure Cognitive services to handle the facial feature detection. I am also using the Business Rules engine on SAP BTP which will handle all the complex calculations and mapping of health insurance policies with the patterns identified by the facial recognition. There is S/4HANA system which will provide details on each of the policy details.
To create an AppGyver project, use the create option from the Application Development lobby. This will open a new tab with a fresh AppGyver project.
Notice that the AppGyver project is within the “Application Development” shell.
In the data configuration, I have setup the config to connect to Azure Face API with the relevant parameters.
The most challenging part of this project was to make the above API call passing an image as a payload. As you can see below, there are many flow functions which I have used for this scenario. I am sure an experience person on AppGyver would be able to simply this further.
I am summarizing the steps for those who are looking to achieve something similar.
- Open the Device camera to take a photo
- Resize the image and reduce them from MBs to KBs as this would have an impact on downloading the images to display on the screen
- Upload files to a repository. For this example, I am using Google Firebase and there is a nice tutorial for this. The photos taken by the camera stores the image as a blob which is local to the device. Hence, its easy if you can store it in a repository available on the internet and reference the image using a HTTPS URL.
- Use the Create Record Flow Function to invoke the Azure Face API and pass the image URL
As mentioned above, I am using Firebase (free tier) to store the selfie images. Note that images have been compressed and are around 75KB.
For this project, I have created 3 pages within AppGyver. The initial page is where the users clicks on a button to take a selfie. The detail page displays the predicted age along with the recommended health plan. The Quote page at the end pull all the plan details from the S/4HANA system and displays them to the user.
Here is the output of the Smart Selfie App.
This approach of using of a photo would be a way to provide an indicative quote followed by a way to obtain specific answers to determine the right policy to lodge a formal application.
I hope this has given you some ideas on how you can use start to use SAP AppGyver to build apps without the need to write a line of code.