BuildIt.CognitiveServices.FaceAPIV10Extensions.FaceDetectAsync C# (CSharp) Method

FaceDetectAsync() public static method

Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes. <ul> <li>Optional parameters for returning faceId, landmarks, and attributes. Attributes include age, gender, smile intensity, facial hair, head pose and glasses. faceId is for other APIs use including <a href="/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239">Face - Identify</a>, <a href="/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a">Face - Verify</a>, and <a href="/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237">Face - Find Similar</a>. The faceId will expire in 24 hours after detection call.</li> <ul> <li>JPEG, PNG, GIF(the first frame), and BMP are supported. The image file size should be larger than or equal to 1KB but no larger than 4MB.</li> <li>The detectable face size is between 36x36 to 4096x4096 pixels. The faces out of this range will not be detected.</li> <li>A maximum of 64 faces could be returned for an image. The returned faces are ranked by face rectangle size in descending order.</li> <li>Some faces may not be detected for technical challenges, e.g. very large face angles (head-pose) or large occlusion. Frontal and near-frontal faces have the best results.</li> <li>Attributes (age, gender, headPose, smile, facialHair, and glasses) are still experimental and may not be very accurate. HeadPose's pitch value is a reserved field and will always return 0.</li> </ul> </li> </ul> <h4>Http Method</h4> POST
public static FaceDetectAsync ( this operations, bool returnFaceId = true, bool returnFaceLandmarks = false, string returnFaceAttributes = default(string), string subscriptionKey = default(string), string ocpApimSubscriptionKey = default(string), System cancellationToken = default(System.Threading.CancellationToken) ) : System.Threading.Tasks.Task
operations this /// The operations group for this extension method. ///
returnFaceId bool /// Return faceIds of the detected faces or not. The default value is true. ///
returnFaceLandmarks bool /// Return face landmarks of the detected faces or not. The default value is /// false. ///
returnFaceAttributes string /// 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, and /// glasses. Note that each face attribute analysis has additional /// computational and time cost. ///
subscriptionKey string /// subscription key in url ///
ocpApimSubscriptionKey string /// subscription key in header ///
cancellationToken System /// The cancellation token. ///
return System.Threading.Tasks.Task
            public static async System.Threading.Tasks.Task FaceDetectAsync(this IFaceAPIV10 operations, bool? returnFaceId = true, bool? returnFaceLandmarks = false, string returnFaceAttributes = default(string), string subscriptionKey = default(string), string ocpApimSubscriptionKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
            {
                await operations.FaceDetectWithHttpMessagesAsync(returnFaceId, returnFaceLandmarks, returnFaceAttributes, subscriptionKey, ocpApimSubscriptionKey, null, cancellationToken).ConfigureAwait(false);
            }