According to Create FaceListId RestAPI, we could use it to create an empty face list with user-specified faceListId, name and an optional userData.
put https://[location].api.cognitive.microsoft.com/face/v1.0/facelists/{faceListId}
If you want to create a facelist you could use the API documentation for test.
PUT https://westus.api.cognitive.microsoft.com/face/v1.0/facelists/tomtest HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: xxxx
{
"name": "tomtestlist",
"userData": "it is optional"
}
Test Result:
If you need Find Similar, you could follow the blow steps:
1.The create facelistid RestAPi just create the empty list. We also need to add face into the facelist.
2.Use the detect api to get the faceid.
3.use the Find similar API
https://[location].api.cognitive.microsoft.com/face/v1.0/findsimilars
{
"faceId": "faceid get from detect api",
"largeFaceListId": "tomtest",
"maxNumOfCandidatesReturned": 10,
"mode": "matchPerson"
}
Note: Face list is a list of faces, up to 1,000 faces, please consider LargeFaceList when the face number is large. It can support up to 1,000,000 faces.