Resolve WES-127-Refactor_Themelist
This commit is contained in:
committed by
Jelle De Geest
parent
564ec209c7
commit
ea13788199
@@ -19,9 +19,9 @@ namespace Mediapipe.Unity.Tutorial
|
||||
public class SignPredictor : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to the model used in the SignPredictor
|
||||
/// ModelList, used to change model using ModelIndex
|
||||
/// </summary>
|
||||
public NNModel model;
|
||||
public ModelList modelList;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the model info file
|
||||
@@ -210,12 +210,22 @@ namespace Mediapipe.Unity.Tutorial
|
||||
|
||||
// check if model exists at path
|
||||
//var model = ModelLoader.Load(Resources.Load<NNModel>("Models/Fingerspelling/model_A-L"));
|
||||
worker = model.CreateWorker();
|
||||
worker = modelList.GetCurrentModel().CreateWorker();
|
||||
|
||||
StartCoroutine(SignRecognitionCoroutine());
|
||||
StartCoroutine(MediapipeCoroutine());
|
||||
}
|
||||
|
||||
public void ChangeModel(ModelIndex index)
|
||||
{
|
||||
this.modelList.SetCurrentModel(index);
|
||||
// If a worker already existed, we throw it out
|
||||
worker?.Dispose();
|
||||
|
||||
// Add a new worker for the new model
|
||||
worker = modelList.GetCurrentModel().CreateWorker();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Coroutine which executes the mediapipe pipeline
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user