Пример #1
0
 public ResultExport(string login, string password, string dataS, string fpath)
 {
     this.login      = login;
     this.password   = password;
     this.dataSource = dataS;
     constr          =
         "User Id=" + this.login + ";" +
         "Password="******";" +
         "Data Source=" + this.dataSource;
     this.con   = new OracleConnection(constr);
     formatter  = new XmlSerializer(typeof(Result[]));
     folderpath = fpath;
     xmlFolder  = new XmlFolder();
 }
Пример #2
0
        public static XmlFolder openFolder()
        {
            string[] arr  = new string[0];
            string   path = "";

            if (Properties.Settings.Default.last_path_to_cascades != "")
            {
                path = Properties.Settings.Default.last_path_to_cascades;
            }
            var dialog = new FolderBrowserDialog();

            dialog.SelectedPath = path;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                path      = dialog.SelectedPath;
                xmlFolder = new XmlFolder();
                xmlFolder.Load(path);
            }
            return(xmlFolder);
        }
Пример #3
0
        private void btn_cascade_open_Click(object sender, EventArgs e)
        {
            var folder = OpenXmlFolderFileDialog.openFolder();

            if (folder.GetFolderPath() != "")
            {
                xmlFolder = folder;
                if (xmlFolder.GetCount() > 0)
                {
                    lCascadeLoaded.Text = "Found " + xmlFolder.GetCount() + " cascades";

                    tb_cascade_path.Text = xmlFolder.GetPath();
                    Properties.Settings.Default.last_path_to_cascades = xmlFolder.GetPath();
                    Properties.Settings.Default.Save();
                    Properties.Settings.Default.Upgrade();
                }
                else
                {
                    lCascadeLoaded.Text = "Cascades not found";
                }
            }
        }
Пример #4
0
        public MainForm()
        {
            InitializeComponent();

            if ((Properties.Settings.Default.last_path_to_videos != "") && (Directory.Exists(Properties.Settings.Default.last_path_to_videos)))
            {
                vidFolder = new VideoFolder();
                vidFolder.Load(Properties.Settings.Default.last_path_to_videos);
                lVideos_count.Text  = "Found " + vidFolder.getCount();
                tb_videos_path.Text = vidFolder.getPath();
            }
            else
            {
                vidFolder = new VideoFolder();
            }

            if (Properties.Settings.Default.last_path_for_images_to_save != "")
            {
                var path = Properties.Settings.Default.last_path_for_images_to_save;
                tb_images_to_save_path.Text = path;
            }

            if ((Properties.Settings.Default.last_path_for_images_to_detect != "") && (Directory.Exists(Properties.Settings.Default.last_path_for_images_to_detect)))
            {
                path_to_detect_images         = Properties.Settings.Default.last_path_for_images_to_detect;
                tb_images_to_detect_path.Text = path_to_detect_images;
                folders_to_detect.Add(path_to_detect_images);
                foreach (string s in Directory.GetDirectories(path_to_detect_images))
                {
                    folders_to_detect.Add(s);
                }

                lFoldersToDetectCount.Text = folders_to_detect.Count.ToString();
                images_count_to_detect     = 0;
                foreach (string p in folders_to_detect)
                {
                    string[] dirs = Directory.GetFiles(p, "*.jpg");
                    images_count_to_detect += dirs.Length;
                }
                lImagesToDetectCount.Text = images_count_to_detect.ToString();
            }

            if (Properties.Settings.Default.last_path_to_cascades != "")
            {
                path_to_cascades = Properties.Settings.Default.last_path_to_cascades;
                if (path_to_cascades.Length != 0)
                {
                    xmlFolder = new XmlFolder();
                    xmlFolder.Load(path_to_cascades);
                    tb_cascade_path.Text = path_to_cascades;
                    if (xmlFolder.GetCount() > 0)
                    {
                        lCascadeLoaded.Text = "Loaded " + xmlFolder.GetCount().ToString();
                    }
                    else
                    {
                        lCascadeLoaded.Text = "Not Exists";
                    }
                    tb_cascade_path.Text = Properties.Settings.Default.last_path_to_cascades;
                }
                else
                {
                    lCascadeLoaded.Text = "Not loaded";
                }
            }
            else
            {
                xmlFolder = new XmlFolder();
            }

            if (Properties.Settings.Default.last_path_for_detected_images_to_save != "")
            {
                var path = Properties.Settings.Default.last_path_for_detected_images_to_save;
                tb_detected_images_to_save_path.Text = path;
            }

            if ((Properties.Settings.Default.last_path_to_learn_pictures != "") && (Directory.Exists(Properties.Settings.Default.last_path_to_learn_pictures)))
            {
                trainFolder = new ImageFolder();
                trainFolder.Load(Properties.Settings.Default.last_path_to_learn_pictures);
                lLearn_count.Text       = "Found " + trainFolder.GetCount();
                tb_train_imgs_path.Text = trainFolder.GetPath();
            }

            if ((Properties.Settings.Default.last_path_to_test_pictures != "") && (Directory.Exists(Properties.Settings.Default.last_path_to_test_pictures)))
            {
                testFolder = new ImageFolder();
                testFolder.Load(Properties.Settings.Default.last_path_to_test_pictures);
                lTest_count.Text       = "Found " + testFolder.GetCount();
                tb_test_imgs_path.Text = testFolder.GetPath();
            }

            if ((Properties.Settings.Default.last_path_to_pictures != "") && (Directory.Exists(Properties.Settings.Default.last_path_to_pictures)))
            {
                recognizeImageFolder = new ImageFolder();
                recognizeImageFolder.Load(Properties.Settings.Default.last_path_to_pictures);
                lImages.Text      = "Found " + recognizeImageFolder.GetCount();
                tb_imgs_path.Text = recognizeImageFolder.GetPath();
            }

            if (Properties.Settings.Default.last_path_to_results_save != "")
            {
                path_to_results_save = Properties.Settings.Default.last_path_to_results_save;
                if (Directory.Exists(path_to_results_save))
                {
                    tb_result_save_path.Text = path_to_results_save;
                }
            }

            if (Properties.Settings.Default.last_path_to_network != "")
            {
                lNetwork.Text = "exists";
                var path = Properties.Settings.Default.last_path_to_network;
                tb_network_path.Text = path;
                network = new CNN(path);
            }
            else
            {
                network = new CNN("");
            }

            //Properties.Settings.Default.is_opened_first_time = true;

            /*if (Properties.Settings.Default.is_opened_first_time)
             * {
             *  MessageBox.Show("Hello new User");
             *  Properties.Settings.Default.is_opened_first_time = false;
             *  Properties.Settings.Default.Save();
             * }*/
        }