当前位置: 首页>>代码示例>>C++>>正文


C++ Args::getNumValues方法代码示例

本文整理汇总了C++中nor_utils::Args::getNumValues方法的典型用法代码示例。如果您正苦于以下问题:C++ Args::getNumValues方法的具体用法?C++ Args::getNumValues怎么用?C++ Args::getNumValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nor_utils::Args的用法示例。


在下文中一共展示了Args::getNumValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: classify

 void SoftCascadeLearner::classify(const nor_utils::Args& args)
 {
     SoftCascadeClassifier classifier(args, _verbose);
             
     string testFileName = args.getValue<string>("test", 0);
     string shypFileName = args.getValue<string>("test", 1);
     int numIterations = args.getValue<int>("test", 2);
             
     string outResFileName = "";
     if ( args.getNumValues("test") > 3 )
         args.getValue("test", 3, outResFileName);
             
     classifier.run(testFileName, shypFileName, numIterations, outResFileName);
 }
开发者ID:junjiek,项目名称:cmu-exp,代码行数:14,代码来源:SoftCascadeLearner.cpp

示例2: classify

	void FilterBoostLearner::classify(const nor_utils::Args& args)
	{
		FilterBoostClassifier classifier(args, _verbose);

		// -test <dataFile> <shypFile>
		string testFileName = args.getValue<string>("test", 0);
		string shypFileName = args.getValue<string>("test", 1);
		int numIterations = args.getValue<int>("test", 2);

		string outResFileName;
		if ( args.getNumValues("test") > 3 )
			args.getValue("test", 3, outResFileName);

		classifier.run(testFileName, shypFileName, numIterations, outResFileName);
	}
开发者ID:ShenWei,项目名称:src,代码行数:15,代码来源:FilterBoostLearner.cpp

示例3: doPosteriors

	void AdaBoostMHLearner::doPosteriors(const nor_utils::Args& args)
	{
		AdaBoostMHClassifier classifier(args, _verbose);
		int numofargs = args.getNumValues( "posteriors" );
		// -posteriors <dataFile> <shypFile> <outFile> <numIters>
		string testFileName = args.getValue<string>("posteriors", 0);
		string shypFileName = args.getValue<string>("posteriors", 1);
		string outFileName = args.getValue<string>("posteriors", 2);
		int numIterations = args.getValue<int>("posteriors", 3);
		int period = 0;
		
		if ( numofargs == 5 )
			period = args.getValue<int>("posteriors", 4);
		
		classifier.savePosteriors(testFileName, shypFileName, outFileName, numIterations, period);
	}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:16,代码来源:AdaBoostMHLearner.cpp

示例4: getArgs

    void SoftCascadeLearner::getArgs(const nor_utils::Args& args)
    {
        if ( args.hasArgument("verbose") )
            args.getValue("verbose", 0, _verbose);

        ///////////////////////////////////////////////////
        // get the output strong hypothesis file name, if given
        if ( args.hasArgument("shypname") )
            args.getValue("shypname", 0, _shypFileName);
        else
            _shypFileName = string(SHYP_NAME);

        _shypFileName = nor_utils::addAndCheckExtension(_shypFileName, SHYP_EXTENSION);


        ///////////////////////////////////////////////////

        //TODO : create an abstract classe for cascade compliant base learners and accept only its offspring!
        // get the name of the learner
        _baseLearnerName = defaultLearner;
        if ( args.hasArgument("learnertype") )
            args.getValue("learnertype", 0, _baseLearnerName);
//            cout << "! Only HaarSingleStumpeLearner is allowed.\n";
        
        // -train <dataFile> <nInterations>
        if ( args.hasArgument("train") )
        {
            args.getValue("train", 0, _trainFileName);
            args.getValue("train", 1, _numIterations);
        }
        // -traintest <trainingDataFile> <testDataFile> <nInterations>
        else if ( args.hasArgument("traintest") ) 
        {
            args.getValue("traintest", 0, _trainFileName);
            args.getValue("traintest", 1, _testFileName);
            args.getValue("traintest", 2, _numIterations);
        }

        // The file with the step-by-step information
        if ( args.hasArgument("outputinfo") )
            args.getValue("outputinfo", 0, _outputInfoFile);
        else
            _outputInfoFile = OUTPUT_NAME;
        
        // --constant: check constant learner in each iteration
        if ( args.hasArgument("constant") )
            _withConstantLearner = true;
        
        if ( args.hasArgument("positivelabel") )
        {
            args.getValue("positivelabel", 0, _positiveLabelName);
        } else {
            cout << "Error : The name of positive label must to given. \n Type --h softcascade to know the mandatory options." << endl;
            exit(-1);
        }
        
        if (args.hasArgument("trainposteriors")) {
            args.getValue("trainposteriors", 0, _trainPosteriorsFileName);
        }

        if (args.hasArgument("testposteriors")) {
            args.getValue("testposteriors", 0, _testPosteriorsFileName);
        }

        if (args.hasArgument("detectionrate")) {
            args.getValue("detectionrate", 0, _targetDetectionRate);
        }
        else {
            cout << "Error : the target detection rate must be given. \n Type --h softcascade to know the mandatory options.";
            exit(-1);
        }

        
        if (args.hasArgument("expalpha")) {
            args.getValue("expalpha", 0, _alphaExponentialParameter);
        }
        else {
            cout << "Error : the parameter used to initialize the rejection distribution vector must be given. \n Type --h softcascade to know the mandatory options.";
            exit(-1);
        }

        if (args.hasArgument("calibrate")) {
            args.getValue("calibrate", 0, _unCalibratedShypFileName);
            if (args.getNumValues("calibrate") > 1) {
                args.getValue("calibrate", 0, _inShypLimit);
            }
        }
        else {
            _fullRun = true;
            _unCalibratedShypFileName = "shypToBeCalibrated.xml";
            cout << "The strong hypothesis file will be seved into the file " << _unCalibratedShypFileName;
            //cout << "Error : the shyp file of the uncalibrated trained classifier must be given ! \n";
            //exit(-1);

        }
        
        if (args.hasArgument("bootstrap")) {
            cout << "Warning ! The bootstrapping set and the training set must come from the same superset. \n";
            args.getValue("bootstrap", 0, _bootstrapFileName);
            args.getValue("bootstrap", 1, _bootstrapRate);
//.........这里部分代码省略.........
开发者ID:junjiek,项目名称:cmu-exp,代码行数:101,代码来源:SoftCascadeLearner.cpp


注:本文中的nor_utils::Args::getNumValues方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。