Ejemplo n.º 1
0
        public static async Task <MNISTModel> CreateMNISTModel(StorageFile file)
        {
            LearningModelPreview learningModel = await LearningModelPreview.LoadModelFromStorageFileAsync(file);

            MNISTModel model = new MNISTModel();

            model.learningModel = learningModel;
            return(model);
        }
Ejemplo n.º 2
0
        public async void Init(InkCanvas inkCanvas)
        {
            _presenter = inkCanvas.InkPresenter;
            _presenter.InputDeviceTypes =
                CoreInputDeviceTypes.Pen |
                CoreInputDeviceTypes.Mouse |
                CoreInputDeviceTypes.Touch;
            _presenter.UpdateDefaultDrawingAttributes(new InkDrawingAttributes()
            {
                Color          = Colors.White,
                Size           = new Size(22, 22),
                IgnorePressure = true,
                IgnoreTilt     = true,
            });
            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(
                new Uri($"ms-appx:///Assets/mnist.onnx"));

            _model = await MNISTModel.CreateMNISTModel(file);
        }