Пример #1
0
        }                                            //MLcontext class where the logic for prediction is located

        public MainWindow()
        {
            //Loads background image on MainWindow
            #region load background img
            var imgDirectory = System.IO.Path.GetFullPath(System.IO.Path.Combine(AppContext.BaseDirectory, "../../"));
            imgDirectory = System.IO.Path.Combine(imgDirectory, "UI_Assets");
            var files = System.IO.Directory.GetFiles(imgDirectory, "*",
                                                     searchOption: System.IO.SearchOption.AllDirectories);
            var label = string.Empty;
            foreach (var img in files)
            {
                label = System.IO.Path.GetFullPath(img);
            }
            ImageBrush image = new ImageBrush
            {
                ImageSource = new BitmapImage(new Uri(label))
            };
            this.Background = image;
            #endregion load background img

            InitializeComponent();
            Context    = new MlContextClass(); //Initialize MLContext
            InputImage = new InputModel();     //Initialize InputModel
        }
Пример #2
0
 public TrainWindow(MlContextClass context)
 {
     InitializeComponent();
     Context = context;
     Images  = new List <ImageData>();
 }