AIML Service
The AIML Service is a miroservice that offers an interface for users to deploy their own ONNX models, thereby facilitating the implementation of AI applications.
ONNX, which stands for Open Neural Network Exchange, is an open-source format for representing deep learning models.
ONNX defines a common set of operators and data types to ensure interoperability across frameworks, making it easier for developers to work with deep learning models in heterogeneous environments.
The West Connectivity platform offers an interface where you can upload your ONNX model along with candidate files for inference.
Follow the setup steps below to enable your own machine learning solution.
Setting up AIML Service
Setting up an AIML service allows you to run inference on your own machine learning model in ONNX format. The AIML service supports dataset and image as input for inference.
In addition, when the input data is an image, the AIML service can optionally perform image preprocessing such as grayscaling, cropping, resizing and normalization, helps in making training more stable as well as increasing the prediction speed.
This page assumes you have a Connectivity account and a solution which Content Service is enabled. You should also have a machine learning model in ONNX format.
Add AIML service to the solution
- In your solution Services page, click ADD SERVICES, it will direct you to the Marketplace.
- In Marketplace Extensions page, type AIML into search box.
- Add AIML Service to your solution.
- Now you should see AIML in your solution Services list.
Upload ONNX model into Content Service
- Click Content tab in your solution.
- Upload your ONNX model.
- If you want to use an image as the input for inference, upload the image as well.
Create endpoint
- Navigate to the Endpoints tab and create a new Http Endpoint. Select the GET method and give it a path (Eg. /inference).
- Select your new endpoint. You will see the script editor. Type Lua script to run the inference and return predictions.
Below are the example Lua script for dataset or image inference.
You should replace the value of dataset to feed into your model, and replace model_name and image_name with the one you just uploaded in the Content Service.
Example Lua script for dataset inference:
Example Lua script for image inference:
Test with the API documentation page
On the Endpoint page of the solution you will see a document link:
Click on it, and it will get to the automatically generated documentation page for your API with your endpoint.
Notice the TRY button, click on it to call your endpoint.
You will get a 200 response with the inference result.