Cleans up the samples after initial load from the tr files, and prior to saving the MasterTrainer: Remaps fragmented chars if running shape anaylsis. Sets up the samples appropriately for class/fontwise access. Deletes outlier samples.
| 232 | // Sets up the samples appropriately for class/fontwise access. |
| 233 | // Deletes outlier samples. |
| 234 | void MasterTrainer::PostLoadCleanup() { |
| 235 | if (debug_level_ > 0) |
| 236 | tprintf("PostLoadCleanup...\n"); |
| 237 | if (enable_shape_anaylsis_) |
| 238 | ReplaceFragmentedSamples(); |
| 239 | SampleIterator sample_it; |
| 240 | sample_it.Init(NULL, NULL, true, &verify_samples_); |
| 241 | sample_it.NormalizeSamples(); |
| 242 | verify_samples_.OrganizeByFontAndClass(); |
| 243 | |
| 244 | samples_.IndexFeatures(feature_space_); |
| 245 | // TODO(rays) DeleteOutliers is currently turned off to prove NOP-ness |
| 246 | // against current training. |
| 247 | // samples_.DeleteOutliers(feature_space_, debug_level_ > 0); |
| 248 | samples_.OrganizeByFontAndClass(); |
| 249 | if (debug_level_ > 0) |
| 250 | tprintf("ComputeCanonicalSamples...\n"); |
| 251 | samples_.ComputeCanonicalSamples(feature_map_, debug_level_ > 0); |
| 252 | } |
| 253 | |
| 254 | // Gets the samples ready for training. Use after both |
| 255 | // ReadTrainingSamples+PostLoadCleanup or DeSerialize. |
nothing calls this directly
no test coverage detected