Discover the essential steps to set up Azure AI Vision, from creating environment variables to running applications. A must-read guide for AI-102 certification candidates!
Table of Contents
Question
Xerigon Corporation uses the Azure AI Vision service. You need to process images and return information on content tags. You have created a Computer Vision resource in Azure.
What else must you do analyze the images?
Place the appropriate choices in the correct order.
Unordered Choices:
- Modify the Program. cs file.
- Create environment variables for the Azure Vision key and URL for the resource.
- Create environment variables for the Azure Vision key and endpoint for the resource.
- Create and run the application.
- Install the ComputerVision client library using Visual Studio.
- View the output.
Answer
Correct Order:
- Create environment variables for the Azure Vision key and endpoint for the resource.
- Install the ComputerVision client library using Visual Studio.
- Modify the Program.cs file.
- Create and run the application.
- View the output.
Explanation
First, you need to create environment variables for the local machine which specify the key for Azure Vision and the endpoint for the Computer Vision resource.
setx VISION_KEY <your_key>
setx VISION_ENDPOINT <your_endpoint>
Next, you would install the ComputerVision client library using Visual Studio. In Solution Explorer of Visual Studio, select the NuGet Packages, select Microsoft.Azure.CognitiveServices.Vision.ComputerVision, and choose Install.
You would modify the Program.cs file by adding the Computer Vision endpoint, the URL for the image, and the authentication for the Computer Vision client similar to the following:
// Add your Computer Vision key and endpoint
static string key = Environment.GetEnvironmentVariable(“VISION_KEY”);
static string endpoint = Environment.GetEnvironmentVariable(“VISION_ENDPOINT”);
Then, you would create and run the application. In Visual Studio, you would run the application by clicking Debug.
Finally, you would view the output from the application. A sample output would look like the following:
———————————————————-
ANALYZE IMAGE – URL
Analyzing the image DogImage16.png…
Tags:
grass 0.9957543611526489
dog 0.9939157962799072
mammal 0.9928356409072876
animal 0.9918001890182495
dog breed 0.9890419244766235
pet 0.974603533744812
outdoor 0.969241738319397
companion dog 0.906731367111206
small greek domestic dog 0.8965123891830444
golden retriever 0.8877675533294678
labrador retriever 0.8746421337127686
puppy 0.872604250907898
ancient dog breeds 0.8508287668228149
field 0.8017748594284058
retriever 0.6837497353553772
brown 0.6581960916519165
You would not specify the URL for the resource in the environment variables. You would specify the URL for the image in the Program.cs file. For example, the following code specifies the URL for an image of a dog:
/ URL image used for analyzing an image of dog
private const string ANALYZE_URL_IMAGE = “https://moderatorsampleimages.blob.core.windows.net/samples/DogImage16.png”;
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.