From eb61c6950cf24e72a545fd751582f1f983114e27 Mon Sep 17 00:00:00 2001 From: Emiliana <38952746+emilianavt@users.noreply.github.com> Date: Fri, 21 Aug 2020 16:40:19 +0200 Subject: [PATCH] Added sensitivity for simple expression detection mode. --- Unity/OpenSeeExpression.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Unity/OpenSeeExpression.cs b/Unity/OpenSeeExpression.cs index 163ad48..0c2250b 100644 --- a/Unity/OpenSeeExpression.cs +++ b/Unity/OpenSeeExpression.cs @@ -18,6 +18,9 @@ public class OpenSeeExpression : MonoBehaviour public bool simpleMode = false; [Tooltip("This smoothing factor is applied to the features used for simple expression detection.")] public float simpleSmoothing = 0.6f; + [Tooltip("This smoothing factor is applied to the features used for simple expression detection.")] + [Range(-1f, 1f)] + public float simpleSensitivity = 0f; [Header("Calibration")] [Tooltip("This specifies which expression calibration data should be collected for.")] public string calibrationExpression = "neutral"; @@ -85,9 +88,9 @@ public class OpenSeeExpression : MonoBehaviour private bool hadSurprised = false; float AdjustThreshold(bool active) { if (active) - return 0.8f; + return Mathf.Clamp(0.8f - simpleSensitivity, -1f, 1f); else - return 1f; + return Mathf.Clamp(1f - simpleSensitivity, -1f, 1f); } void ThresholdDetection() { lastMouthCorner = lastMouthCorner * simpleSmoothing + (openSeeData.features.MouthCornerUpDownLeft + openSeeData.features.MouthCornerUpDownRight) * 0.5f * (1f - simpleSmoothing);