/spare-parts-recognition-scp

A code snippet for spare parts recognition deployed on SAP Cloud Platform

Primary LanguageJavaScriptMIT LicenseMIT

Spare Part Recognition - A Simple Integration between SAP Business One / ByDesign and SAP Leonardo

avatar

This is a sample integration of SAP Business One or SAP Business ByDesign with SAP Leonardo. It uses SAP Leonardo APIs to extract the features vectors of a given input product image and then find out the smiliar items.

Overview

Installation in the Cloud

Clone this repository

$ git clone https://github.com/CyranoChen/spare-parts-recognition-scp

Give a name to your app on the manifest.yml

Then set the global variables configuration in [manifest] It also requires a SAP Leonardo API Key which you can retrive AFTER login into the API Hub and clicking on GET API KEY.

LEON_APIKEY: <-- YOUR OWN LEONARDO API KEY-->
LEON_IMAGEFEATUREEXTRACTION_APIURL: https://sandbox.api.sap.com/ml/imagefeatureextraction/feature-extraction
LEON_SIMILARITYSCORING_APIURL: https://sandbox.api.sap.com/ml/similarityscoring/similarity-scoring

This project depends on an instance of B1 HANA environment and set the adminstrator account for accessing the service layer.

B1_SERVICELAYER_APIURL: https://<B1 hostname>:50000/b1s/v1 
B1_USERNAME: <username> 
B1_PASSWORD: <password>
B1_COMPANYDB: <companydb>

This project also integrate with an instance of ByDesign and set the adminstrator account for accessing the odata api of product data.

The odata api configuration profile should be imported by custom odata services.

BYD_TENANT_HOSTNAME: https://<ByDesign Tenant>/sap/byd/odata/cust/v1 
BYD_USERNAME: <username> 
BYD_PASSWORD: <password>

From the root directory, using the Cloud Foundry CLI push your app to the SAP CP Cloud Foundry

$ cf push
or
$ cf push --random-route
–random-route will avoid name collisions with others that deploy this same app on SCP. You can also choose your own app name by changing the manifest.yml file.

Access the app from the URL route shown in the terminal

Demo app

There is a sample implementation running here. Be advised that the B1 System Backend is not running 24/7

License

This code snippet is released under the terms of the MIT license. See LICENSE for more information or see https://opensource.org/licenses/MIT.