Wes xx gpu test
This commit is contained in:
committed by
Jerome Coudron
parent
1cceb3cb89
commit
1f5b855f61
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user