AI-102 Question 156
Single answerYou have trained a Custom Vision model in Azure to classify images into different categories. You now need to integrate this model into a web application for real-time image classification. Which step is necessary to consume the Custom Vision model in your application?
- A
Export the model to ONNX format and integrate it directly in the application.
- B
Use the Custom Vision Prediction API endpoint and key to make predictions.
- C
Deploy the model to an Azure Kubernetes Service (AKS) cluster before integration.
- D
Download the model as a TensorFlow file and rebuild it for your application.
Show answer and explanation
Correct answer: B
Explanation
Custom Vision models hosted in Azure can be consumed directly using the Custom Vision Prediction API. This approach requires the model's prediction endpoint and key, which can be obtained from the Azure portal. It allows for seamless integration into applications, enabling real-time predictions by sending images to the API.
- A. Incorrect.
Exporting the model to ONNX format is only required if you intend to use the model offline or with a different framework. It is not necessary for consumption through the Custom Vision service.
- B. Correct.
Using the Custom Vision Prediction API endpoint and key is the correct approach for consuming a Custom Vision model in a web application. The API provides a simple way to send images and receive predictions.
- C. Incorrect.
Deploying the model to an Azure Kubernetes Service (AKS) cluster is an optional step if you want to containerize and scale the model. However, it is not mandatory for consuming the model in a web application.
- D. Incorrect.
Downloading the model as a TensorFlow file is not a standard option provided by the Custom Vision service unless you export it for specific offline use cases. This is not required for standard API consumption.