Beispiel #1
0
        private void Btn_runML_Click(object sender, RoutedEventArgs e)
        {
            MainWindow.mMainWindow.listBox.Items.Clear();
            switch (MLCore.MLModelSelected)
            {
            case MLModel.ResNet:
                ResNet.EvaluationSingleImage(GV.imgOriginal);

                for (int i = 0; i < ResNet.resultList.Count; i++)
                {
                    MainWindow.mMainWindow.listBox.Items.Add(string.Format("{0}: {1}", MLCore.MLSelectedLabels[i], ResNet.resultList[i]));
                }
                BindMngr.GMessage.value = string.Format("This must be a {0}!", ResNet.OutputString, ResNet.OutputProbablility);
                break;

            case MLModel.FastRCNN:
                FastRCNN.EvaluateObjectDetectionModel();
                break;

            case MLModel.Yolo:
                GV.imgProcessed = new Image <Bgr, byte>(mYolo.Detect(GV.imgOriginal.ToBitmap()));
                MainWindow.mMainWindow.ibOriginal.Source = ImgConverter.ToBitmapSource(GV.imgProcessed);
                break;
            }
        }
        public static List <PredResult> GroceryDetection()
        {
            string   imagePath = string.Format("{0}images\\grocery.jpg", AppDomain.CurrentDomain.BaseDirectory);
            FastRCNN app       = new FastRCNN(FastRCNNModel.Grocery100);

            app.LoadModel();
            return(app.Predict(imagePath));
        }
Beispiel #3
0
        public static List <PredResult> PascalDetection()
        {
            string   imagePath = string.Format("{0}\\images\\objdet.jpg", AppDomain.CurrentDomain.BaseDirectory);
            FastRCNN app       = new FastRCNN(FastRCNNModel.Pascal);

            app.LoadModel();
            return(app.Predict(imagePath));
        }