
Explanation:
Box 1: Stream
The File.OpenRead(String) method opens an existing file for reading.
Example: Open the stream and read it back.
using (FileStream fs = File.OpenRead(path))
Box 2: AddFaceFromStreamAsync
Example:
File.OpenRead() returns a Stream object.
using (Stream stream = File.OpenRead(imagePath))
{
await faceClient.PersonGroupPerson.AddFaceFromStreamAsync(personGroupId, personId, stream);
}
Reference:
https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/how-to- add-faces