AI-102 Question 157
Select 3You have trained a custom vision model in Azure Custom Vision and published it for prediction. Your client application now needs to classify images by sending them to the published endpoint. Which steps should you follow to consume the custom vision model in your application?
- A
Obtain the prediction endpoint URL and prediction key from the Azure Portal.
- B
Install the Azure Custom Vision SDK in your application.
- C
Convert the image to Base64 format before sending it to the endpoint.
- D
Send an HTTP POST request to the prediction endpoint with the image file and prediction key in the request headers.
- E
Write a model deployment script to host the model on an Azure Virtual Machine.
Show answer and explanation
Correct answers: A, B, D
Explanation
To consume a custom vision model, you first need to obtain the prediction endpoint URL and key from the Azure Portal, as these are required for authentication and communication with the model. Installing the Azure Custom Vision SDK is recommended because it provides convenient methods to manage and interact with the prediction service. The application sends an HTTP POST request to the endpoint with the image file and prediction key to receive predictions. There is no need to convert the image to Base64 or deploy the model manually, as Azure Custom Vision handles hosting for published models.
- A. Correct.
Correct: To consume the custom vision model, you need the prediction endpoint URL and prediction key, which are provided in the Azure Portal after publishing the model.
- B. Correct.
Correct: The Azure Custom Vision SDK simplifies interacting with the prediction endpoint and is recommended for integrating the model into your application.
- C. Incorrect.
Incorrect: Images do not need to be converted to Base64 format for the Custom Vision API; you can directly send the image file or URL.
- D. Correct.
Correct: An HTTP POST request with the image file and prediction key in the headers is the standard approach to send data to the Custom Vision endpoint.
- E. Incorrect.
Incorrect: The model is already hosted by Azure Custom Vision after publishing; no additional deployment script is required.