question

AminMaredia-0759 avatar image
0 Votes"
AminMaredia-0759 asked GiftA-MSFT commented

Identify face against the entire PersonDirectory not working

I am using "Scenario 3: Identify against the entire PersonDirectory" example code from https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/use-persondirectory

The code does not work. It gives following error
"error": {
"code": "BadArgument",
"message": "Request body is invalid."
}

The Actual Code is below
Note: Verify code works but identify code does not work. I use Azure Cognitive Vision Face 2.7.0-preview.1 client library to detect the face. and It successfully returns the faceid which i used for identification in person directory.

95543-faceidentity.jpg


azure-cognitive-services
faceidentity.jpg (205.9 KiB)
· 2
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.

The sample code from microsoft site which i implemented.

95545-facesample.jpg


0 Votes 0 ·
facesample.jpg (86.8 KiB)

Hi, thanks for reaching out. Can you try debugging your code, what line are you getting this error from? Also, from looking at your code, may I suggest entering the faceid strings manually to verify that you are entering parameter values correctly?

0 Votes 0 ·

1 Answer

AminMaredia-0759 avatar image
0 Votes"
AminMaredia-0759 answered GiftA-MSFT commented

Hi,

There is no debug error. I found the issue with below line on example provided Microsoft Documentation website.

body.Add("personIds","['*']");

The below line resolve the issue

body.Add("personIds", new List<string> { "*"});

· 1
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.

Good observation and thanks for the updates. Will follow up up with he doc author to update the document accordingly. Thanks!

0 Votes 0 ·