0

I am trying to analyze the emotion data using the affdex sdk integration in my Unity game. Below is the piece of code that I am using to get the emotions from face.

public float currentJoy;
public override void onImageResults(Dictionary<int, Face> faces)
{
    if (faces.Count > 0)
    {
        // get emotions
        faces[0].Emotions.TryGetValue(Emotions.Joy, out currentJoy);
        // similarly get other emotions
    }
}

Usually, there is only one face in front of the camera, but often it happens that there is another smaller face in the camera view. For example, consider the following picture.

enter image description here

If something similar happens while recording emotions, a main face in front of the camera and a smaller face somewhere behind. faces.Count would be greater than 1 in such a case. Would faces[0] still refer to the main face in front of the camera, or will be be random. For me there is no way to verify it myself, since I can't really say with certainty that whose emotions are being captured.

4
  • You should ask this here if you can't find out testing it, how should we know how this SDK was implemented? Simply get a very happy and a very sad face, switch positions, move around and watch what happens to your indexes I guess ;)
    – derHugo
    Nov 21, 2019 at 6:39
  • Yes, I have asked them as well. but they also suggested to put it here with the affdex tag in it, so I did, along with posting in their forum. Nov 21, 2019 at 6:47
  • As it is a Dictionary I would expect the same as you: The SDK tries to match recognized faces to already known ones and keeps their indices. But who knows how they did it, though ;)
    – derHugo
    Nov 21, 2019 at 7:10
  • Thanks for letting me know. I will wait to hear back from them. Nov 21, 2019 at 7:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.