Ejemplo n.º 1
0
        public static async Task <RoadSignDetectionMLModel> CreateFromStreamAsync(IRandomAccessStreamReference stream)
        {
            RoadSignDetectionMLModel learningModel = new RoadSignDetectionMLModel();

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

            learningModel.session = new LearningModelSession(learningModel.model);
            learningModel.binding = new LearningModelBinding(learningModel.session);
            return(learningModel);
        }
Ejemplo n.º 2
0
        public static async Task <RoadSignDetectionMLModel> Createmlmodel(StorageFile file)
        {
            LearningModel learningModel = null;

            try
            {
                learningModel = await LearningModel.LoadFromStorageFileAsync(file);
            }
            catch (Exception e)
            {
                var exceptionStr = e.ToString();
                System.Console.WriteLine(exceptionStr);
                throw e;
            }
            var model = new RoadSignDetectionMLModel()
            {
                model   = learningModel,
                session = new LearningModelSession(learningModel),
            };

            model.binding = new LearningModelBinding(model.session);

            return(model);
        }