예제 #1
0
        /// <summary>
        /// Initialize Yolo
        /// </summary>
        /// <param name="configurationFilename">Yolo configuration (.cfg) file path</param>
        /// <param name="weightsFilename">Yolo trained data (.weights) file path</param>
        /// <param name="namesFilename">Yolo object names (.names) file path</param>
        /// <param name="gpuConfig">Gpu Index if multiple graphic devices available</param>
        /// <param name="yoloSystemValidator">Yolo System validator</param>
        /// <exception cref="NotSupportedException">Thrown when the process not run in 64bit</exception>
        /// <exception cref="YoloInitializeException">Thrown if an error occurs during initialization</exception>
        public YoloWrapper(string configurationFilename, string weightsFilename, string namesFilename, GpuConfig gpuConfig = null, IYoloSystemValidator yoloSystemValidator = null)
        {
            if (yoloSystemValidator == null)
            {
                yoloSystemValidator = new DefaultYoloSystemValidator();
            }

            _yoloSystemValidator = yoloSystemValidator;
            Initialize(configurationFilename, weightsFilename, namesFilename, gpuConfig);
        }
예제 #2
0
        /// <summary>
        /// Initialize Yolo
        /// </summary>
        /// <param name="yoloConfiguration"></param>
        /// <param name="gpuConfig">GPU Configuration</param>
        /// <param name="yoloSystemValidator">Yolo System validator</param>
        /// <exception cref="NotSupportedException">Thrown when the process not run in 64bit</exception>
        /// <exception cref="YoloInitializeException">Thrown if an error occurs during initialization</exception>
        public YoloWrapper(YoloConfiguration yoloConfiguration, GpuConfig gpuConfig = null, IYoloSystemValidator yoloSystemValidator = null)
        {
            if (yoloSystemValidator == null)
            {
                yoloSystemValidator = new DefaultYoloSystemValidator();
            }

            _yoloSystemValidator = yoloSystemValidator;
            Initialize(yoloConfiguration.ConfigFile, yoloConfiguration.WeightsFile, yoloConfiguration.NamesFile, gpuConfig);
        }