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

Definition

Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.<br />

  • Optional parameters including faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise.
  • The extracted face feature, instead of the actual image, will be stored on server. The faceId is an identifier of the face feature and will be used in Face - Identify, Face - Verify, and Face - Find Similar. It will expire 24 hours after the detection call.
  • Higher face image quality means better detection and recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
  • JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
  • Faces are detectable when its size is 36x36 to 4096x4096 pixels. If need to detect very small but clear faces, please try to enlarge the input image.
  • Up to 64 faces can be returned for an image. Faces are ranked by face rectangle size from large to small.
  • Face detector prefer frontal and near-frontal faces. There are cases that faces may not be detected, e.g. exceptionally large face angles (head-pose) or being occluded, or wrong image orientation.
  • Attributes (age, gender, headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise) may not be perfectly accurate. HeadPose's pitch value is a reserved field and will always return 0.
  • Different 'recognitionModel' values are provided. If follow-up operations like Verify, Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More details, please refer to How to specify a recognition model
public static System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.CognitiveServices.Vision.Face.Models.DetectedFace>> DetectWithUrlAsync (this Microsoft.Azure.CognitiveServices.Vision.Face.IFaceOperations operations, string url, 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 DetectWithUrlAsync : Microsoft.Azure.CognitiveServices.Vision.Face.IFaceOperations * string * 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.

url
String String

Publicly reachable URL of an image

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