Resolve WES-127-Refactor_Themelist
This commit is contained in:
committed by
Jelle De Geest
parent
564ec209c7
commit
ea13788199
8
Assets/MediaPipeUnity/ScriptableObjects.meta
Normal file
8
Assets/MediaPipeUnity/ScriptableObjects.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 438a3ced42dd6fc4ab38e3a16c1e43a7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
20
Assets/MediaPipeUnity/ScriptableObjects/ModelList.asset
Normal file
20
Assets/MediaPipeUnity/ScriptableObjects/ModelList.asset
Normal file
@@ -0,0 +1,20 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 78a3f61c93a08c04496c49ffd10b9021, type: 3}
|
||||
m_Name: ModelList
|
||||
m_EditorClassIdentifier:
|
||||
currentModelIndex: 0
|
||||
models:
|
||||
- index: 0
|
||||
model: {fileID: 5022602860645237092, guid: e6d85df707405ad4f97c23b07227ee99, type: 3}
|
||||
- index: 1
|
||||
model: {fileID: 5022602860645237092, guid: e6d85df707405ad4f97c23b07227ee99, type: 3}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39516e4e6e56f0f4f80647d9c4d8034c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,7 +6,8 @@
|
||||
"GUID:5c2b5ba89f9e74e418232e154bc5cc7a",
|
||||
"GUID:04c4d86a70aa56c55a78c61f1ab1a56d",
|
||||
"GUID:edc93f477bb73a743a97d6882ed330b3",
|
||||
"GUID:58e104b97fb3752438ada2902a36dcbf"
|
||||
"GUID:58e104b97fb3752438ada2902a36dcbf",
|
||||
"GUID:7f2d0ee6dd21e1d4eb25b71b7a749d25"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
||||
@@ -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