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

@@ -8,7 +8,8 @@
"GUID:58e104b97fb3752438ada2902a36dcbf",
"GUID:7f2d0ee6dd21e1d4eb25b71b7a749d25",
"GUID:f55a02e98b01bc849b30d9650ccd8f15",
"GUID:d23f64cfd3b314bb4a18a8284c99bf5e"
"GUID:d23f64cfd3b314bb4a18a8284c99bf5e",
"GUID:e83ddf9a537a96b4a804a16bb7872ec1"
],
"includePlatforms": [],
"excludePlatforms": [],

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