Ejemplo n.º 1
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();
            }
        }
Ejemplo n.º 2
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++;
                    }
                }
            }
        }