FaceClient throws APIErrorException 'NotFound' in v2.0.0-preview
See original GitHub issueThe following code, using Microsoft.Azure.CognitiveServices.Vision.Face
v2.0.0-preview, throws Microsoft.Azure.CognitiveServices.Vision.Face.Models.APIErrorException
:
Operation returned an invalid status code ‘NotFound’
readonly FaceClient FaceApiClient = new FaceClient(new ApiKeyServiceClientCredentials(CognitiveServicesConstants.FaceApiKey));
public static async Task<List<Emotion>> GetEmotionResults(Stream photo)
{
var faceApiResponseList = await FaceApiClient.Face.DetectWithStreamAsync(photo, returnFaceAttributes: new List<FaceAttributeType> { { FaceAttributeType.Emotion } }).ConfigureAwait(false);
return faceApiResponseList.Select(x => x.FaceAttributes.Emotion).ToList();
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Call to Microsoft.Azure.CognitiveServices.Vision.Face. ...
IList<DetectedFace> faceList = await faceClient.Face. ... "Operation returned an invalid status code 'NotFound'". I've checked the keys, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sebasjian Use the Base URL of the endpoint instead of the full endpoint url.
E.g., use https://westus.api.cognitive.microsoft.com instead of of https://westus.api.cognitive.microsoft.com/face/v1.0
I opened this Issue which addresses that problem: https://github.com/Azure/azure-sdk-for-net/issues/4633
This worked for me!