Create the Visualforce Page
Now you create a Visualforce page that calls the classes that you just created to make a prediction.
-
In Salesforce, from Setup, enter
Visualforce
in the Quick Find box, then select Visualforce Pages. -
Click New.
-
Enter a label and name of Predict.
-
From the
README.md
file, copy all of the code from<apex:page Controller="VisionController">
to</apex:page>
and paste it into the code editor.
-
Click Save.
-
Click Preview to test out the page.
Your page shows the prediction results from the General Image Classifier, and the classifier is pretty sure it’s a picture of a tree frog.
Congratulations! You wrote code to call the Einstein Image Classification API to make a prediction with an image, and all from within your Salesforce org.