Create the Visualforce Page

Now you create a Visualforce page that calls the classes that you just created to make a prediction.

  1. In Salesforce, from Setup, enter Visualforce in the Quick Find box, then select Visualforce Pages.

  2. Click New.

  3. Enter a label and name of Predict.

  4. 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.

  1. Click Save.

  2. 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.