1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef _NICE_OBJREC_GENERICFPCLASSIFIERSELECTION_INCLUDE
- #define _NICE_OBJREC_GENERICFPCLASSIFIERSELECTION_INCLUDE
- //STL
- #include <vector>
- //core
- #include "core/basics/StringTools.h"
- //vislearning -- feature pool classifier
- #include "vislearning/classifier/fpclassifier/boosting/FPCBoosting.h"
- #include "vislearning/classifier/fpclassifier/randomforest/FPCRandomForests.h"
- #include "vislearning/classifier/fpclassifier/randomforest/FPCDecisionTree.h"
- #include "vislearning/classifier/fpclassifier/logisticregression/FPCSMLR.h"
- #include "vislearning/classifier/fpclassifier/gphik/FPCGPHIK.h"
- namespace OBJREC {
- class GenericFPClassifierSelection
- {
- public:
- static FeaturePoolClassifier *selectFPClassifier ( const NICE::Config *conf, std::string classifier_type )
- {
- std::vector<std::string> submatches;
- OBJREC::FeaturePoolClassifier *classifier = NULL;
- ////////////////////////////////////////
- // //
- // all Feature Pool Classifiers //
- // //
- ////////////////////////////////////////
- if ( classifier_type == "GPHIK" )
- {
- classifier = new OBJREC::FPCGPHIK ( conf, "GPHIK" );
- }
- else if ( classifier_type == "random_forest" ) {
- classifier = new OBJREC::FPCRandomForests ( conf, "RandomForest" );
- }
- else if ( classifier_type == "sparse_logistic_regression" )
- {
- classifier = new OBJREC::FPCSMLR ( conf, "SparseLogisticRegression" );
- }
- else if ( classifier_type == "boost" )
- {
- classifier = new OBJREC::FPCBoosting ( conf, "Boost" );
- }
- else if ( classifier_type == "decision_tree" )
- {
- classifier = new OBJREC::FPCDecisionTree ( conf, "DecisionTree" );
- } else
- {
- fthrow ( NICE::Exception, "Classifier type " << classifier_type << " not (yet) supported." << std::endl <<
- "(genericFPClassifierSelection.h contains a list of classifiers to choose from)" );
- }
- return classifier;
- }
- };
- }
- #endif
|