Forum Discussion
Almxdena
3 years agoProtege
Obtaining the weight of each of the configured emotions in the MacroFacialExpressionDetector script
Dear colleagues, I am working with the facial tracking technique using the new Meta Quest Pro. I find it great that it works with the FACS system, as there is enough literature on the internet to co...
jaume.gallego
3 years agoExplorer
Hello,
please, can you share how did you configure the emotions?
Moreover, Did you solve how to have the weighted emotions?
Thank you
Almxdena
3 years agoProtege
Yes, I solved this and for sure I can share it with you.
Can you share how did you configure the emotions?
The MacroFacialExpressionDetector script is where you have to define the name of an emotion. There's a line of code similar to this one. Each of the names correspond to an emotion, but just the name. I added Sadness, Anger and Surprise.
public enum MacroExpressionType {
Happiness = 0, Sadness, Anger, Surprise
}If you save the script, you will be able to add different microgestures to each emotion in the Unity editor. Just look for the FACS system to understand which configuration correspond to each emotion.
Moreover, Did you solve how to have the weighted emotions?
Well, I got this but out of Unity. On the other hand, I was able to obtaine the weight for each microgesutre. I attach the script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Oculus.Movement.Effects;
using System.IO;
using TMPro;
public class ExpressionThreshold : MonoBehaviour
{
[Header("Emotion displayed")]
public TextMeshProUGUI _text1;
public TextMeshProUGUI _text2;
public OVRFaceExpressions faceExpression;
#region expressions and weights
//Add as many expressions and weights as you need
public OVRFaceExpressions.FaceExpression leftEyeBlink;
public OVRFaceExpressions.FaceExpression rightEyeBlink;
public float weightL;
public float weightR;
#endregion
void Update()
{
weightL = faceExpression[leftEyeBlink];
weightR = faceExpression[rightEyeBlink];
}
//We can display the expression weight using this void
public void WeightExpression (float expressionWeight, OVRFaceExpressions.FaceExpression expression)
{
expressionWeight = faceExpression[expression];
_text1.text = expressionWeight.ToString();
_text2.text = expression.ToString();
Debug.Log(expressionWeight);
}
}- jaume.gallego3 years agoExplorer
Hello Almxdena,
Thank you for this great answer. Sorry I cannot find the MacroFacialExpressionDetector script. Please, can you tell me in which library can I find this script?
Thank you again.- Almxdena3 years agoProtege
I am not sure if the script is included in the Meta Interaction SDK or in this example project that you need to import to Unity in order to use the face-tracking https://github.com/oculus-samples/Unity-Movement
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago