azureazure-cognitive-servicesface-api

Azure Face API - How to manage very large volumes (more than 30 million faces)


I am using LargeFaceGroup to store the faces. The usecase I am dealing with has more than 30 millions of faces. On these 30 millions Images, I need to run Face-Identify call as well.

The limitation of LargeFaceGroup is - It can only hold upto 1 million. If I use 30 LargeFaceGroup I will have to make 30 Face-Identify to find match between 30 million faces. Hence making 30 API transaction for finding match for a single face.

I have few question:

  1. Is there any more efficient way to deal with large volumes.
  2. How can I optimize API Cost and time? (example- I have found out that we can pass upto 10 faceIds to Face-Identify, thus reducing the API transaction by 10 fold)
  3. Can I also detect/add/delete faces in batch, or I will have to make API transaction for each individual faces?
  4. What is the search time for Face-Identify in a LargeFaceGroup. Is is dependent upon the number of faces present in the LargeFaceGroup?

Solution

  • After a discussion with the Azure Face API product team. I got answers to these questions.

    1. To handle large volumes, we should use PersonDirectory to store faces. It can handle up to 75 million faces. There is no training cost in PersonDirectory data structure as well.

    2. As mentioned in the first point. Training costs can be eliminated. Time can be optimized - You can request more than 10TPS from Azure, and they will allow it. Other API calls such as detect,Add-Face, and Delete-Face can not be optimized. (Some hacks like stitching multiple images to one and then call detect on it can save API calls. You can check if this is suitable for the use case). Rather you should focus that you are not having some redundant API calls such as 2 detect calls, rather save the faceid and make subsequent calls within 24 hours.

    3. Apart from the hack for detect. You will have to call API for each individual Image/Face.

    4. I am not sure about the response time for an individual query, but while handling large volumes we are concerned about the throughput of the API, and throughput can be increased from 10 TPS to some upper limit as desired.

    Face API Doc - https://westus.dev.cognitive.microsoft.com/docs/services/face-v1-0-preview/operations/563879b61984550f30395239