37 {
38 tesseract::CheckSharedLibraryVersion();
40 if (FLAGS_model.empty()) {
41 tprintf(
"Must provide a --model!\n");
42 return 1;
43 }
44 if (FLAGS_eval_listfile.empty()) {
45 tprintf(
"Must provide a --eval_listfile!\n");
46 return 1;
47 }
49 if (!mgr.
Init(FLAGS_model.c_str())) {
50 if (FLAGS_traineddata.empty()) {
51 tprintf(
"Must supply --traineddata to eval a training checkpoint!\n");
52 return 1;
53 }
54 tprintf(
"%s is not a recognition model, trying training checkpoint...\n",
55 FLAGS_model.c_str());
56 if (!mgr.
Init(FLAGS_traineddata.c_str())) {
57 tprintf(
"Failed to load language model from %s!\n",
58 FLAGS_traineddata.c_str());
59 return 1;
60 }
63 tprintf(
"Failed to load model from: %s\n", FLAGS_model.c_str());
64 return 1;
65 }
68 }
70 1048576);
71 if (!tester.LoadAllEvalData(FLAGS_eval_listfile.c_str())) {
72 tprintf(
"Failed to load eval data from: %s\n", FLAGS_eval_listfile.c_str());
73 return 1;
74 }
75 double errs = 0.0;
77 tester.RunEvalSync(0, &errs, mgr,
78 0, FLAGS_verbosity);
80 return 0;
81}
DLLSYM void tprintf(const char *format,...)
void ParseArguments(int *argc, char ***argv)
bool LoadDataFromFile(const char *filename, GenericVector< char > *data)
const char * string() const
void OverwriteEntry(TessdataType type, const char *data, int size)
bool Init(const char *data_file_name)