22 #ifndef TESSERACT_TRAINING_MASTERTRAINER_H__
23 #define TESSERACT_TRAINING_MASTERTRAINER_H__
47 class ShapeClassifier;
72 bool replicate_samples,
int debug_level);
87 feature_map_.
Init(fs);
99 void AddSample(
bool verification,
const char* unichar_str,
166 return tr_filenames_[index];
176 int shape_id,
int* num_samples);
186 const char* inttemp_file,
187 const char* pffmtable_file);
196 return master_shapes_;
201 void DebugCanonical(
const char* unichar_str1,
const char* unichar_str2);
202 #ifndef GRAPHICS_DISABLED
214 const char* unichar_str2,
int canonical_font);
215 #endif // GRAPHICS_DISABLED
225 bool replicate_samples,
243 bool replicate_samples,
256 void ReplaceFragmentedSamples();
263 void ClusterShapes(
int min_shapes,
int max_shape_unichars,
290 bool enable_shape_anaylsis_;
292 bool enable_replication_;
296 int prev_unichar_id_;
bool LoadFontInfo(const char *filename)
void LoadPageImages(const char *filename)
void TestClassifierVOld(bool replicate_samples, ShapeClassifier *test_classifier, ShapeClassifier *old_classifier)
void SetupFlatShapeTable(ShapeTable *shape_table)
void AddSample(bool verification, const char *unichar_str, TrainingSample *sample)
bool Serialize(FILE *fp) const
bool operator<(const ShapeDist &other) const
void DisplaySamples(const char *unichar_str1, int cloud_font, const char *unichar_str2, int canonical_font)
int GetFontInfoId(const char *font_name)
double TestClassifier(CountTypes error_mode, int report_level, bool replicate_samples, TrainingSampleSet *samples, ShapeClassifier *test_classifier, STRING *report_string)
FEATURE_DEFS_STRUCT feature_defs
void Init(const IntFeatureSpace &feature_space)
const STRING & GetTRFileName(int index) const
bool LoadXHeights(const char *filename)
void ReplicateAndRandomizeSamplesIfRequired()
const UNICHARSET & unicharset() const
int GetBestMatchingFontInfoId(const char *filename)
void LoadUnicharset(const char *filename)
void TestClassifierOnSamples(CountTypes error_mode, int report_level, bool replicate_samples, ShapeClassifier *test_classifier, STRING *report_string)
float ShapeDistance(const ShapeTable &shapes, int s1, int s2)
const UNICHARSET & unicharset() const
bool DeSerialize(bool swap, FILE *fp)
MasterTrainer(NormalizationMode norm_mode, bool shape_analysis, bool replicate_samples, int debug_level)
const ShapeTable & master_shapes() const
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)
void ReadTrainingSamples(const char *page_name, const FEATURE_DEFS_STRUCT &feature_defs, bool verification)
ShapeDist(int s1, int s2, float dist)
void SetFeatureSpace(const IntFeatureSpace &fs)
void DebugCanonical(const char *unichar_str1, const char *unichar_str2)
CLUSTERER * SetupForClustering(const ShapeTable &shape_table, const FEATURE_DEFS_STRUCT &feature_defs, int shape_id, int *num_samples)
TrainingSampleSet * GetSamples()
bool AddSpacingInfo(const char *filename)