Project Oxford Api emotions - "Invalid Face image"

Category: project oxford

Question

Ryan Barrie (MSFT CSG) on Sun, 03 Jan 2016 01:52:55


From @gcore777

I have a question about prj oxford api, emotions. i am passing the binary image data in but it gives me: "Invalid face image."

Thanks,

@AzureSupport

Replies

cthrash99 on Mon, 04 Jan 2016 16:55:01


This implies that the algorithm had an issue parsing the image.  It's hard to diagnose more precisely without the image data itself.  Is that something you can share?

Note also the following restrictions (coped from docs) "The supported input image formats includes JPEG, PNG, GIF(the first frame), BMP. Image file size should be no larger than 4MB."

Abdo Salem on Fri, 19 Feb 2016 22:19:06


I have the same issue using the image
https://media.licdn.com/mpr/mpr/shrink_100_100/p/3/000/23a/20e/3ab9649.jpg

when I pass the url the API sends the proper response but when I send the binary of the image, it gives me that "Invalid face image."

cthrash99 on Sat, 20 Feb 2016 00:24:48


How exactly are you uploading the bitmap?  I downloaded that image and the service appears to be OK with it.  Did you remember to set the Content-Type header?
curl "https://api.projectoxford.ai/emotion/v1.0/recognize" -H "Content-Type: application/octet-stream" -H "Ocp-Apim-Subscription-Key: {my-key}" --data-binary @bad.jpg

[{"faceRectangle":{"height":51,"left":21,"top":39,"width":51},"scores":{"anger":1.77320089E-07,"contempt":1.27951607E-05,"disgust":2.02570689E-08,"fear":6.14219742E-09,"happiness":0.8638988,"neutral":0.136087462,"sadness":7.45012E-07,"surprise":9.072006E-09}}]