tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
18 #ifdef GOOGLE_TESSERACT
19 #include "base/commandlineflags.h"
27 static STRING_PARAM_FLAG(model,
"",
"Name of model file (training or recognition)");
29 "If model is a training checkpoint, then traineddata must "
30 "be the traineddata file that was given to the trainer");
32 "File listing sample files in lstmf training format.");
33 static INT_PARAM_FLAG(max_image_MB, 2000,
"Max memory to use for images.");
35 "Amount of diagnosting information to output (0-2).");
37 int main(
int argc,
char **argv) {
38 tesseract::CheckSharedLibraryVersion();
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());
#define INT_PARAM_FLAG(name, val, comment)
#define STRING_PARAM_FLAG(name, val, comment)
bool LoadDataFromFile(const char *filename, GenericVector< char > *data)
void OverwriteEntry(TessdataType type, const char *data, int size)
const char * c_str() const
int main(int argc, char **argv)
void ParseArguments(int *argc, char ***argv)
bool Init(const char *data_file_name)
DLLSYM void tprintf(const char *format,...)
STRING RunEvalSync(int iteration, const double *training_errors, const TessdataManager &model_mgr, int training_stage, int verbosity)
bool LoadAllEvalData(const STRING &filenames_file)