#include <classifier_factory.h>
Definition at line 31 of file classifier_factory.h.
Definition at line 35 of file classifier_factory.cpp.
41 FeatureBase *feat_extract;
43 switch (params->TypeFeature()) {
45 feat_extract =
new FeatureBmp(params);
48 feat_extract =
new FeatureChebyshev(params);
51 feat_extract =
new FeatureHybrid(params);
54 fprintf(stderr,
"Cube ERROR (CharClassifierFactory::Create): invalid "
59 if (feat_extract ==
NULL) {
60 fprintf(stderr,
"Cube ERROR (CharClassifierFactory::Create): unable "
61 "to instantiate feature extraction object.\n");
66 CharClassifier *classifier_obj;
67 switch (params->TypeClassifier()) {
69 classifier_obj =
new ConvNetCharClassifier(char_set, params,
73 classifier_obj =
new HybridNeuralNetCharClassifier(char_set, params,
77 fprintf(stderr,
"Cube ERROR (CharClassifierFactory::Create): invalid "
78 "classifier type.\n");
82 if (classifier_obj ==
NULL) {
83 fprintf(stderr,
"Cube ERROR (CharClassifierFactory::Create): error "
84 "allocating memory for character classifier object.\n");
89 if (!classifier_obj->Init(data_file_path,
lang, lang_mod)) {
90 delete classifier_obj;
91 fprintf(stderr,
"Cube ERROR (CharClassifierFactory::Create): unable "
92 "to Init() character classifier object.\n");
95 return classifier_obj;
The documentation for this class was generated from the following files: