コード例 #1
0
ファイル: Main.cs プロジェクト: HaxThePlanet/Alturos.Yolo
        public string GetGraphicDeviceName(GpuConfig gpuConfig)
        {
            if (gpuConfig == null)
            {
                return(string.Empty);
            }

            //var systemReport = this._yoloSystemValidator.Validate();
            //if (!systemReport.CudaExists || !systemReport.CudnnExists)
            //{
            return("unknown");

            //}

            //var deviceName = new StringBuilder(); //allocate memory for string
            //GetDeviceName(gpuConfig.GpuIndex, deviceName);
            return("");
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: tonyle8/Yolo.Net
        private void Initialize(YoloConfiguration config)
        {
            try
            {
                if (_yoloWrapper != null)
                {
                    _yoloWrapper.Dispose();
                }

                var gpuConfig  = new GpuConfig();
                var useOnlyCpu = cpuToolStripMenuItem.Checked;
                if (useOnlyCpu)
                {
                    gpuConfig = null;
                }

                toolStripStatusLabelYoloInfo.Text = $"Initialize...";

                var sw = new Stopwatch();
                sw.Start();
                _yoloWrapper = new YoloWrapper(config.ConfigFile, config.WeightsFile, config.NamesFile, gpuConfig);
                sw.Stop();

                var action = new MethodInvoker(delegate
                {
                    var deviceName = _yoloWrapper.GetGraphicDeviceName(gpuConfig);
                    toolStripStatusLabelYoloInfo.Text = $"Initialize Yolo in {sw.Elapsed.TotalMilliseconds:0} ms - Detection System:{_yoloWrapper.DetectionSystem} {deviceName} Weights:{config.WeightsFile}";
                });

                statusStrip1.Invoke(action);
                buttonProcessImage.Invoke(new MethodInvoker(delegate { buttonProcessImage.Enabled = true; }));
                buttonStartTracking.Invoke(new MethodInvoker(delegate { buttonStartTracking.Enabled = true; }));
            }
            catch (Exception exception)
            {
                MessageBox.Show($"{nameof(Initialize)} - {exception}", "Error Initialize", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }