question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FaceClient throws APIErrorException 'NotFound' in v2.0.0-preview

See original GitHub issue

The 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:closed
  • Created 5 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
brminnickcommented, Oct 4, 2018

@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

4reactions
Ayoolacommented, Oct 18, 2019

@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: #4633

This worked for me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

FaceClient Class
An API for face detection, verification, and identification.
Read more >
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found