This application implements some of the SAP Leonardo Machine Learning APIs for image processing.
- It is coded in NodeJ
- Can be deployed anywhere and I suggest to do it in the SAP Cloud Platform.
- It makes use of the Image Feature Extraction, Similarity Scoring and Image Classifier APIs
Clone this repository
$ git clone https://github.com/Ralphive/leoImg.git
Give a name to your app on the manifest.yml
From the root directory, using the Cloud Foundry CLI push your app to the SAP CP Cloud Foundry:
$ cf push --random-route
--random-route will avoids name colisions with others that deploy this same app on SCP. You can choose your own app name by changing the application names in the manifest
It's ok if you get an error at this point
It also requires a SAP Leonardo API Key which you can retrive AFTER login into the API Hub and clicking on GET API KEY.
$ cf set-env <yourAppName> LEO_API_KEY <YOUR API KEY>
Restart your application (so it can read the new environment variables)
$ cf restart <your app name set on the manifest.yml>
Access the app from the URL route shown in the terminal
There are two functionalities
- Find similar items: If you upload a shoe picture, it will give you a similar item in return. You can have your own comparision database by adding pictures to the /files/imgs folder.
- Categorize: It works with any kind of picture
There is a sample implementation running here.
leoimg is released under the terms of the MIT license. See LICENSE for more information or see https://opensource.org/licenses/MIT.