コード例 #1
0
            public async Task <MediaCaptureWrapper> Create()
            {
                var wrapper = new MediaCaptureWrapper();
                await wrapper.Initialize();

                return(wrapper);
            }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: grozaserban/Leaf
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _captureManager = await new MediaCaptureWrapperFactory().Create();

            capturePreview.Source = _captureManager.MediaCapture;
            //    _captureManager.StartPreview();

            var picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);

            await Task.Run(() =>
            {
                _classifier = NeuralNetFactory.CreateNetWithPredefinedWeights(picturesLibrary.SaveFolder.Path + @"\weights.txt", 13, 6);
            });
        }