22 #ifndef TESSERACT_TRAINING_MASTERTRAINER_H_ 23 #define TESSERACT_TRAINING_MASTERTRAINER_H_ 47 class ShapeClassifier;
72 bool replicate_samples,
int debug_level);
84 feature_map_.
Init(fs);
96 void AddSample(
bool verification,
const char* unichar_str,
163 return tr_filenames_[index];
173 int shape_id,
int* num_samples);
183 const char* inttemp_file,
184 const char* pffmtable_file);
193 return master_shapes_;
198 void DebugCanonical(
const char* unichar_str1,
const char* unichar_str2);
199 #ifndef GRAPHICS_DISABLED 211 const char* unichar_str2,
int canonical_font);
212 #endif // GRAPHICS_DISABLED 222 bool replicate_samples,
240 bool replicate_samples,
253 void ReplaceFragmentedSamples();
260 void ClusterShapes(
int min_shapes,
int max_shape_unichars,
287 bool enable_shape_analysis_;
289 bool enable_replication_;
293 int prev_unichar_id_;
309 #endif // TESSERACT_TRAINING_MASTERTRAINER_H_
bool LoadXHeights(const char *filename)
void DisplaySamples(const char *unichar_str1, int cloud_font, const char *unichar_str2, int canonical_font)
const UNICHARSET & unicharset() const
bool AddSpacingInfo(const char *filename)
void LoadUnicharset(const char *filename)
void AddSample(bool verification, const char *unichar_str, TrainingSample *sample)
bool operator<(const ShapeDist &other) const
ShapeDist(int s1, int s2, float dist)
float ShapeDistance(const ShapeTable &shapes, int s1, int s2)
void TestClassifierVOld(bool replicate_samples, ShapeClassifier *test_classifier, ShapeClassifier *old_classifier)
void Init(const IntFeatureSpace &feature_space)
MasterTrainer(NormalizationMode norm_mode, bool shape_analysis, bool replicate_samples, int debug_level)
void DebugCanonical(const char *unichar_str1, const char *unichar_str2)
double TestClassifier(CountTypes error_mode, int report_level, bool replicate_samples, TrainingSampleSet *samples, ShapeClassifier *test_classifier, STRING *report_string)
CLUSTERER * SetupForClustering(const ShapeTable &shape_table, const FEATURE_DEFS_STRUCT &feature_defs, int shape_id, int *num_samples)
void LoadPageImages(const char *filename)
FEATURE_DEFS_STRUCT feature_defs
void TestClassifierOnSamples(CountTypes error_mode, int report_level, bool replicate_samples, ShapeClassifier *test_classifier, STRING *report_string)
void ReplicateAndRandomizeSamplesIfRequired()
void SetFeatureSpace(const IntFeatureSpace &fs)
int GetFontInfoId(const char *font_name)
bool LoadFontInfo(const char *filename)
const ShapeTable & master_shapes() const
const UNICHARSET & unicharset() const
bool Serialize(FILE *fp) const
void ReadTrainingSamples(const char *page_name, const FEATURE_DEFS_STRUCT &feature_defs, bool verification)
void SetupFlatShapeTable(ShapeTable *shape_table)
TrainingSampleSet * GetSamples()
int GetBestMatchingFontInfoId(const char *filename)
void WriteInttempAndPFFMTable(const UNICHARSET &unicharset, const UNICHARSET &shape_set, const ShapeTable &shape_table, CLASS_STRUCT *float_classes, const char *inttemp_file, const char *pffmtable_file)
const STRING & GetTRFileName(int index) const