From 9f55f4137aba28d374d34f0aced05c9254e833f3 Mon Sep 17 00:00:00 2001 From: Emiliana <38952746+emilianavt@users.noreply.github.com> Date: Mon, 7 Sep 2020 14:50:18 +0200 Subject: [PATCH] Made ThunderSVM optional. --- Unity/OpenSeeExpression.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Unity/OpenSeeExpression.cs b/Unity/OpenSeeExpression.cs index e69f982..9e138d7 100644 --- a/Unity/OpenSeeExpression.cs +++ b/Unity/OpenSeeExpression.cs @@ -13,6 +13,8 @@ public class OpenSeeExpression : MonoBehaviour [Header("Settings")] [Tooltip("This is the source of face tracking data. If it is not set, any OpenSee component on the current object is used.")] public OpenSee openSee; + [Tooltip("When enabled ThunderSVM is used instead of LibSVM, which is usually faster, but may cause issues on some systems.")] + public bool useThunderSVM = false; [Header("Simple mode")] [Tooltip("When enabled, some simple heuristics will be used to detect expressions, rather than an SVM model. Outputs one of: neutral, fun, angry, surprise")] public bool simpleMode = false; @@ -362,7 +364,10 @@ public class OpenSeeExpression : MonoBehaviour } ResetInfo(); expressions = new Dictionary>(); - model = new ThunderSVMModel(); + if (useThunderSVM) + model = new ThunderSVMModel(); + else + model = new SVMModel(); rnd = new System.Random(); } @@ -416,8 +421,10 @@ public class OpenSeeExpression : MonoBehaviour return false; } modelReady = false; - if (model is SVMModel) + if (model is SVMModel && useThunderSVM) model = new ThunderSVMModel(); + else if (model is ThunderSVMModel && !useThunderSVM) + model = new SVMModel(); SelectPoints(); List keys = new List(); List accuracyWarnings = new List();