AI-102 Question 159
Select 3You have trained a custom image classification model using Azure Custom Vision and published the model to an endpoint. You now need to consume this model in a client application to classify images. Which steps must you perform to successfully consume the model and interpret the results?
- A
Send an HTTP POST request to the prediction endpoint URL with the image data in the request body.
- B
Include the Prediction-Key in the request header for authentication.
- C
Use the Training-Key to authenticate the request and retrieve predictions.
- D
Parse the JSON response from the prediction endpoint to extract the classification probabilities and predicted labels.
- E
Deploy the model as a Kubernetes container before it can be consumed.
Show answer and explanation
Correct answers: A, B, D
Explanation
To consume a Custom Vision model, you need to send an HTTP POST request to the model's prediction endpoint with the image data and include the Prediction-Key in the request header for authentication. After receiving the prediction response, you must parse the JSON data to extract the classification results. Using the Training-Key or deploying the model as a Kubernetes container is not part of the standard consumption process for a Custom Vision model hosted on Azure.
- A. Correct.
Correct. To consume the model, you need to send an HTTP POST request to the Custom Vision prediction endpoint URL with the image data (binary or base64) in the request body.
- B. Correct.
Correct. The Prediction-Key is mandatory to authenticate the request when interacting with the published prediction endpoint.
- C. Incorrect.
Incorrect. The Training-Key is used only during the training phase of the model. For consuming the model, the Prediction-Key is required.
- D. Correct.
Correct. The JSON response from the Custom Vision endpoint contains the classification probabilities and predicted labels, which need to be parsed to interpret the results.
- E. Incorrect.
Incorrect. Deploying the model as a Kubernetes container is not a requirement for consuming a Custom Vision model. The model is already hosted on the Azure service and can be accessed via the prediction endpoint.