question

JosephLee-0434 avatar image
0 Votes"
JosephLee-0434 asked GiftA-MSFT commented

Face API calls slow down

I have writing a c# program to compare faces in 2 URLs (3 calls per compare)

It works but when I start to run 300 comparisons, it slow than at around 200 calls. Initial it can do 2 compare (6 calls) per second but then suddenly drop to few seconds per compare, but no error arise.

I am using trial subscription and using standard S0 as I have free US$200 quota. Is that related?

Thanks.

azure-face
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, thanks for reaching out. According to the documentation, S0 tier has a limit of 10 transactions per second. A transaction is a single API call. Hope this helps.


0 Votes 0 ·

I understand the limit is 10 TPS, but my question is why in my experience, it drops from 6 TPS to less than 1 TPS after around 500-600 calls. and it is sharply decrease, like hitting a boundary

0 Votes 0 ·

Are these calls happening in parallel?

0 Votes 0 ·
 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;
         }
     }
 }
0 Votes 0 ·

0 Answers