public static async Task <ArcFaceModel> CreateFromStreamAsync(IRandomAccessStreamReference stream) { ArcFaceModel learningModel = new ArcFaceModel(); learningModel.model = await LearningModel.LoadFromStreamAsync(stream); learningModel.session = new LearningModelSession(learningModel.model); learningModel.binding = new LearningModelBinding(learningModel.session); return(learningModel); }
private async void LoadModel() { StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ArcFace.onnx")); _arcFaceModel = await ArcFaceModel.CreateFromStreamAsync(file as IRandomAccessStreamReference); await objectDetection.Init(await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///BearFace.onnx"))); LoadFace(); _ready = true; }