Пример #1
0
        public static async Task <celebrityModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
        {
            celebrityModel learningModel = new celebrityModel();

            learningModel.model = await LearningModel.LoadFromStreamAsync(stream);

            learningModel.session = new LearningModelSession(learningModel.model);
            learningModel.binding = new LearningModelBinding(learningModel.session);
            return(learningModel);
        }
Пример #2
0
        private async void LoadModel()
        {
            StorageFile modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Assets/celebrity.onnx"));

            modelGen = await celebrityModel.CreateFromStreamAsync(modelFile as IRandomAccessStreamReference);
        }