Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

EmotionServiceClient does not return scores #102

@bveldkamp

Description

@bveldkamp

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions