Beispiel #1
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (NeuralEngine.IsExist())
     {
         NeuralEngine.Instance.Save();
     }
     Application.Exit();
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var processedImage = NeuralEngine.PreprocessImage(new Bitmap(pictureBoxArt.Image));

            pictureBoxArt.Image = processedImage;
            var category = NeuralEngine.Instance.Classify(processedImage);

            labelCategory.Text = "Category: " + category;
        }
Beispiel #3
0
        private void CheckCategoryForm_Load(object sender, EventArgs e)
        {
            var data = NeuralEngine.GetImages();

            if (data.Count == 0)
            {
                MessageBox.Show("Add some art first!");
                _parentForm.Show();
                Close();
            }
            else
            {
                NeuralEngine.Instance.TrainClasificationNetwork();
            }
        }
Beispiel #4
0
        private void BrowseForm_Load(object sender, EventArgs e)
        {
            var data = NeuralEngine.GetImages();

            if (data.Count == 0)
            {
                MessageBox.Show("Add some art first!");
                _parentForm.Show();
                Close();
            }
            else
            {
                var imageIndex = 0;
                for (var i = 0; i < data.Count(); i++)
                {
                    ListViewGroup viewGroup;
                    var           category = data.Keys.ElementAt(i);
                    if (listView1.Groups[category] == null)
                    {
                        viewGroup = new ListViewGroup(category, category);
                        listView1.Groups.Add(viewGroup);
                    }
                    else
                    {
                        viewGroup = listView1.Groups[category];
                    }


                    var images    = data.Values.ElementAt(i);
                    var filenames = Directory.GetFiles("pictures/" + category);
                    for (var j = 0; j < images.Count; j++)
                    {
                        var image = images[j];
                        imageList1.Images.Add(image);
                        var item = new ListViewItem(new DirectoryInfo(filenames[j]).Name, imageIndex, viewGroup);
                        listView1.Items.Add(item);
                        imageIndex++;
                    }
                }
            }
        }