Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EmotionServiceClient does not return scores #102

Open
bveldkamp opened this issue Nov 22, 2017 · 2 comments
Open

EmotionServiceClient does not return scores #102

bveldkamp opened this issue Nov 22, 2017 · 2 comments

Comments

@bveldkamp
Copy link

bveldkamp commented Nov 22, 2017

With version 1.0.341 of Microsoft.ProjectOxford.Emotion, the Scores property is null, although I can see scores when inspecting the request with Fiddler.

My code is

async void RecognizeEmotion(string imageFilePath)
{
    var client =new Microsoft.ProjectOxford.Emotion.EmotionServiceClient(EmotionKey);

    using (var imageStream = File.OpenRead(imageFilePath))
    {
        var emotions = await client.RecognizeAsync(imageStream);
        foreach (var emotion in emotions)
        {
            Console.WriteLine($@"Scores are {(emotion.Scores == null ? "" : "not ")}null");
        }
    }
}

The response from the service is:
[{"faceRectangle":{"height":606,"left":2642,"top":1268,"width":606},"scores":{"anger":0.00768282,"contempt":0.00425829645,"disgust":0.02712952,"fear":0.00047837582,"happiness":0.0009950536,"neutral":0.798720837,"sadness":0.152901679,"surprise":0.007833431}}]

Am I missing something, or is there something wrong in the Emotion code?

@GKersten
Copy link

GKersten commented Nov 24, 2017

I am experiencing the same issue ATM. Did you find a solution?

Edit: Seems to be an issue when we created a new UWP .NET Standard project. When using .NET Framework it seems to work.

@bveldkamp
Copy link
Author

No solution yet, I'm using .NET Framework.

This seems to be related: microsoft/Cognitive-Emotion-Windows#26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants