Start tracking your progress
Trailhead Home
Trailhead Home

Create the Visualforce Page

Create the Visualforce Page

Now you create the Visualforce page that calls the classes that you just created and displays the prediction results.
  1. In Salesforce, from Setup, enter Visualforce in the Quick Find box, then select Visualforce Pages.
  2. Click New.
  3. For Label, type Predict.
    The Name field automatically populates based on this entry.
  4. From README.md, copy all of the code from <apex:page Controller="VisionController"> to </apex:page> and paste it in the Visualforce Markup tab.
    The Visualforce page after you copy the code.
  5. Click Save.

Test the Visualforce Page

The time has come to test out all your hard work. To refresh your memory, you run the code you created, and that code calls the Einstein Image Classification API. The code sends the image of the tree frog to the general image classifier (by referencing the image URL), and returns a prediction.
  1. From the Visualforce page you created, click Preview. 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. If you don’t see any prediction results, ensure that you verified your Einstein Platform Services account. Check your email for a link to verify your new account.
    The picture of the tree frog and the prediction returned by the API.
Congratulations! You just called the Einstein Image Classification API, sent an image into an existing model, and received a prediction back from the model.