How to access prediction values for different emotions?


I am trying to build off the code provided for by doing different things for the dominant emotion. For example, if the prediction value for joy is > 50, do something. If the prediction value for sadness > 75 do something else, etc. I am trying to do this in a function inside of my main javascript file. So far, my function looks like this:

function printToConsole(face){
console.log(“found joy”);
However, this is not correct and I am unsure how to correctly access the prediction values. I am getting an error that says “Uncaught TypeError: Cannot read property ‘emotions’ of undefined”.

This is my first time using Affectiva and any help would be greatly appreciated.

I’ve already familiarized myself with the code at, but am still having trouble understanding how to access the prediction values. I am mostly interested in accessing the values for joy, sadness and anger.


Figured it out :slightly_smiling_face:


Closing this is for now.