19 #ifdef GOOGLE_TESSERACT 20 #include "base/commandlineflags.h" 30 "If model is a training checkpoint, then traineddata must " 31 "be the traineddata file that was given to the trainer");
33 "File listing sample files in lstmf training format.");
34 INT_PARAM_FLAG(max_image_MB, 2000,
"Max memory to use for images.");
36 "Amount of diagnosting information to output (0-2).");
38 int main(
int argc,
char **argv) {
40 if (FLAGS_model.empty()) {
41 tprintf(
"Must provide a --model!\n");
44 if (FLAGS_eval_listfile.empty()) {
45 tprintf(
"Must provide a --eval_listfile!\n");
49 if (!mgr.
Init(FLAGS_model.c_str())) {
50 if (FLAGS_traineddata.empty()) {
51 tprintf(
"Must supply --traineddata to eval a training checkpoint!\n");
54 tprintf(
"%s is not a recognition model, trying training checkpoint...\n",
56 if (!mgr.
Init(FLAGS_traineddata.c_str())) {
57 tprintf(
"Failed to load language model from %s!\n",
58 FLAGS_traineddata.c_str());
63 tprintf(
"Failed to load model from: %s\n", FLAGS_model.c_str());
72 tprintf(
"Failed to load eval data from: %s\n", FLAGS_eval_listfile.c_str());
int main(int argc, char **argv)
const char * string() const
STRING_PARAM_FLAG(model, "", "Name of model file (training or recognition)")
void OverwriteEntry(TessdataType type, const char *data, int size)
STRING RunEvalSync(int iteration, const double *training_errors, const TessdataManager &model_mgr, int training_stage, int verbosity)
bool LoadDataFromFile(const char *filename, GenericVector< char > *data)
bool Init(const char *data_file_name)
bool LoadAllEvalData(const STRING &filenames_file)
void ParseArguments(int *argc, char ***argv)
INT_PARAM_FLAG(max_image_MB, 2000, "Max memory to use for images.")