Learn how to build an image classification app using Azure Custom Vision. Discover the correct sequence of steps, from tagging images to testing prediction endpoints, for successful implementation.
Table of Contents
Question
You work for Xerigon Corporation which uses the Custom Vision service. You need to create an image classification project with the Custom Vision client library and the REST API.
You have performed the following steps:
- Created the necessary environmental variables on the virtual machine running the application.
- Created the C# application with Visual Studio.
- Created a new Custom Vision project.
What should you do in order to use the app for image recognition?
Place the steps in the correct order.
Unordered Choices:
- Test the prediction endpoint
- Train the project
- Add tags
- Upload and tag images
- Publish the current model
Answer
Correct Order:
- Add tags
- Upload and tag images
- Train the project
- Publish the current model
- Test the prediction endpoint
Explanation
First, you would add tags to your project. Tags will define how you train your model. For example, the following defines two tags in the new project:
private static void AddTags(CustomVisionTrainingClient trainingApi, Project project) { // Make two tags in the new project PineTag = trainingApi.CreateTag(project.Id, "Pine"); DogwoodTag = trainingApi.CreateTag(project.Id, "Dogwood"); }
You would then upload and tag the images. You can create a method to upload the images and apply tags.
Once tags have been applied, you would train the project. The following code segment creates a method to train the project:
private static void TrainProject(CustomVisionTrainingClient trainingApi, Project project) { // Now there are images with tags start training the project Console.WriteLine("\tTraining"); iteration = trainingApi.TrainProject(project.Id); // The returned iteration will be in progress, and can be queried periodically to see when it has completed while (iteration.Status == "Training") { Console.WriteLine("Waiting 30 seconds for training to complete..."); Thread.Sleep(30000); // Re-query the iteration to get it's updated status iteration = trainingApi.GetIteration(project.Id, iteration.Id); } }
Once you have trained the model, you would publish it. You would then query the model by using the model’s endpoint and view the prediction data output.
You should test the prediction endpoint several times for accuracy,
Microsoft Azure AI Engineer Associate AI-102 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Azure AI Engineer Associate AI-102 exam and earn Microsoft Azure AI Engineer Associate AI-102 certification.