Resolve WES-100 "Natml integration"

This commit is contained in:
Jelle De Geest
2023-04-03 14:14:49 +00:00
parent edf1805a92
commit f95e34c6fe
425 changed files with 525 additions and 96655 deletions

View File

@@ -1,8 +1,7 @@
using NatML;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Barracuda;
/// <summary>
/// This scriptable will hold tupples of Courseindices and models
/// </summary>
@@ -22,28 +21,49 @@ public class ModelList : ScriptableObject
/// <summary>
/// The model itself
/// </summary>
public NNModel model;
public MLModelData modelWINDOWS;
/// <summary>
/// The model itself
/// </summary>
public MLModelData modelMAC;
}
/// <summary>
/// Index of the currently active model
/// </summary>
public int currentModelIndex = 0;
/// <summary>
/// A list of all the models
/// </summary>
public List<ModelTuple> models = new List<ModelTuple>();
/// <summary>
/// Index of the currently active model
/// </summary>
public int currentModelIndex = 0;
/// <summary>
/// Get a model by modelindex
/// </summary>
/// <param name="modelIndex">ModelIndex of the model</param>
/// <returns>Model associated with this index, null if no model was found</returns>
public NNModel GetCurrentModel()
public MLModelData GetCurrentModel()
{
return models.Find(x => x.model == models[currentModelIndex].model)?.model;
// Select Model based on OS
#if (UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
return models.Find(x => x.modelWINDOWS == models[currentModelIndex].modelWINDOWS)?.modelWINDOWS;
#elif (UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX)
return models.Find(x => x.modelMAC == models[currentModelIndex].modelMAC)?.modelMAC;
#endif
return null;
}
/// <summary>
/// Function to check if the modelIndex has been set
/// </summary>
/// <returns></returns>
public bool HasValidModel()
{
return models[currentModelIndex].index != (int)ModelIndex.NONE;
}
/// <summary>