1 year ago

#357317

test-img

redsimon

Azure Face API call slow down after ~350 comparsion

I have just created a trial account in Azure and trying to do a batch processing of face comparison through c# program

My program calls DetectWithUrlAsync twice and call VerifyFaceToFaceAsync once for each comparison

It works for a small number of calls, but when tested for 500 pairs of faces, it suddens become very slow after doing 350 comparisons (350x3 calls). Orginal is less than 1 second but now more than a few seconds per call.

I am using the standard plan because I think I am using the $200 free credit. Don't know what is happening.

private async Task<VerifyResult> Verify(IFaceClient faceClient, string url1, string url2, string recognition_model)
{
    var faces_1 = faceClient.Face.DetectWithUrlAsync(url1, recognitionModel: recognition_model, detectionModel: DetectionModel.Detection03);
    var faces_2 = faceClient.Face.DetectWithUrlAsync(url2, recognitionModel: recognition_model, detectionModel: DetectionModel.Detection03);
    Task.WaitAll(new Task<IList<DetectedFace>>[] { faces_1, faces_2 });
    return await faceClient.Face.VerifyFaceToFaceAsync((Guid)faces_1.Result[0].FaceId, (Guid)faces_2.Result[0].FaceId);
}

main()
{
    for (int i = 0; i < count; i++)
    {
        VerifyResult result = await Verify(client, url[i].url1, url[i].url2, RECOGNITION_MODEL4);
        if (result != null)
        {
            wks.Cells[2 + i, ColSame] = result.IsIdentical ? "Yes" : "No";
            wks.Cells[2 + i, ColConfidence] = result.Confidence;
        }
    }
}

azure

face

slowdown

0 Answers

Your Answer

Accepted video resources