예제 #1
0
        private void LoadModel(string modelPath)
        {
            ModelPath model = new ModelPath(modelPath);

            _aspectRatio = model.FixedAspectRatio;
            ClearMessage();
            if (model.Found)
            {
                _yolo = new Yolo(model.ConfigPath, model.WeightsPath, model.NamesPath);
                this.pictureBox1.AllowDrop = true;
                string processName = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule.FileName);
                string title       = $"{Path.GetFileNameWithoutExtension(model.NamesPath)} - {processName}";
                this.Text = title;
                AppendMessage($"{model.ConfigPath},{model.WeightsPath},{model.NamesPath} を読み込みました。\r\n画像を Drag&Drop してください。");
            }
            else
            {
                AppendMessage($"ファイルが見つかりませんでした。{_modelPath} フォルダに .cfg, .weights, .names ファイルを1つずつ配置してください。");
            }
        }
예제 #2
0
        private void LoadModel(string modelPath)
        {
            ModelPath model = new ModelPath(modelPath);

            _aspectRatio = model.FixedAspectRatio;
            ClearMessage();
            if (model.Found)
            {
                _yolo = new YoloSharp.Yolo(model.ConfigPath, model.WeightsPath, model.NamesPath);
                this.pictureBox1.AllowDrop = true;
                string processName = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().MainModule.FileName);
                //string title = $"{Path.GetFileNameWithoutExtension(model.NamesPath)} - {processName}";
                this.Text = "动态物体检测"; //title;
                AppendMessage($"{model.ConfigPath},{model.WeightsPath},{model.NamesPath} 已安装。\r\n请 Drag&Drop 图像。");
            }
            else
            {
                AppendMessage($"无法找到该文件。 请在文件夹{_modelPath}中逐一放置一个.cfg,.weights,.names文件");
            }
        }