Wes xx gpu test

This commit is contained in:
Jelle De Geest
2023-05-14 19:41:37 +00:00
committed by Jerome Coudron
parent 1cceb3cb89
commit 1f5b855f61
10 changed files with 1118 additions and 14 deletions

View File

@@ -364,11 +364,26 @@ public class SignPredictor : MonoBehaviour
// Check if a model is ready to load
yield return new WaitUntil(() => modelList.HasValidModel());
// Create Model
Task<MLEdgeModel> t = Task.Run(() => MLEdgeModel.Create(modelList.GetCurrentModel()));
NatML.MLEdgeModel.Configuration myConfig = null;
// Create Configuration
if (PersistentDataController.GetInstance().IsUsingGPU())
{
// Create a new instance of the Configuration class
myConfig = new NatML.MLEdgeModel.Configuration();
// Set the computeTarget property to GPU
myConfig.computeTarget = NatML.MLEdgeModel.ComputeTarget.GPU;
}
Task<MLEdgeModel> t = Task.Run(() => MLEdgeModel.Create(modelList.GetCurrentModel(), myConfig));
yield return new WaitUntil(() => t.IsCompleted);
model = t.Result;
predictor_embed = new NatMLSignPredictorEmbed(model);
asyncPredictor = predictor_embed.ToAsync();
// Creating a KeypointManager