The code will perform face recognition → No
The code will list tags and their associated confidence → Yes
The code will read a file from the local file system → Yes
The given method uses the Computer Vision client library:
It specifies the features:
List < VisualFeatureTypes > features = new List < VisualFeatureTypes > ()
{
VisualFeatureTypes.Description,
VisualFeatureTypes.Tags,
};
That means it will return descriptions (captions) and tags from the image.
The image is opened from the local file system:
using (Stream imageStream = File.OpenRead(localImage))
The analysis call:
ImageAnalysis results = await client.AnalyzeImageInStreamAsync(imageStream, features);
It prints captions and tags with their confidence values.
Statement Analysis
“The code will perform face recognition.”
No.
The requested features are Description and Tags , not Faces .
Face recognition would require VisualFeatureTypes.Faces .
“The code will list tags and their associated confidence.”
Yes.
The foreach (var tag in results.Tags) loop outputs tag name and confidence.
“The code will read a file from the local file system.”
Yes.
It uses File.OpenRead(localImage) which reads from disk.
Final Answer
The code will perform face recognition → No
The code will list tags and their associated confidence → Yes
The code will read a file from the local file system → Yes
Microsoft References
Analyze an image with the Computer Vision API
VisualFeatureTypes enum reference