FaceOperationsExtensions.DetectWithStreamAsync(IFaceOperations, Stream, Nullable<Boolean>, Nullable<Boolean>, IList<FaceAttributeType>, String, Nullable<Boolean>, CancellationToken) FaceOperationsExtensions.DetectWithStreamAsync(IFaceOperations, Stream, Nullable<Boolean>, Nullable<Boolean>, IList<FaceAttributeType>, String, Nullable<Boolean>, CancellationToken) Method

Definition

Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.

public static System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.DetectedFace>> DetectWithStreamAsync (this Microsoft.Azure.CognitiveServices.Vision.Face.IFaceOperations operations, System.IO.Stream image, Nullable<bool> returnFaceId = true, Nullable<bool> returnFaceLandmarks = false, System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.FaceAttributeType> returnFaceAttributes = null, string recognitionModel = null, Nullable<bool> returnRecognitionModel = false, System.Threading.CancellationToken cancellationToken = null);
static member DetectWithStreamAsync : Microsoft.Azure.CognitiveServices.Vision.Face.IFaceOperations * System.IO.Stream * Nullable<bool> * Nullable<bool> * System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.FaceAttributeType> * string * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.DetectedFace>>

Parameters

operations
IFaceOperations IFaceOperations

The operations group for this extension method.

image
Stream Stream

An image stream.

returnFaceId
Nullable<Boolean>

A value indicating whether the operation should return faceIds of detected faces.

returnFaceLandmarks
Nullable<Boolean>

A value indicating whether the operation should return landmarks of the detected faces.

returnFaceAttributes
IList<FaceAttributeType>

Analyze and return the one or more specified face attributes in the comma-separated string like "returnFaceAttributes=age,gender". Supported face attributes include age, gender, headPose, smile, facialHair, glasses and emotion. Note that each face attribute analysis has additional computational and time cost.

recognitionModel
String String

Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition model name can be provided when performing Face - Detect or (Large)FaceList - Create or (Large)PersonGroup

  • Create. The default value is 'recognition_01', if latest model needed, please explicitly specify the model you need. Possible values include: 'recognition_01', 'recognition_02'
returnRecognitionModel
Nullable<Boolean>

A value indicating whether the operation should return 'recognitionModel' in response.

cancellationToken
CancellationToken CancellationToken

The cancellation token.

Returns

Applies to