Go to the source code of this file.
|
| STRING_PARAM_FLAG (model, "", "Name of model file (training or recognition)") |
|
| STRING_PARAM_FLAG (traineddata, "", "If model is a training checkpoint, then traineddata must " "be the traineddata file that was given to the trainer") |
|
| STRING_PARAM_FLAG (eval_listfile, "", "File listing sample files in lstmf training format.") |
|
| INT_PARAM_FLAG (max_image_MB, 2000, "Max memory to use for images.") |
|
| INT_PARAM_FLAG (verbosity, 1, "Amount of diagnosting information to output (0-2).") |
|
int | main (int argc, char **argv) |
|
◆ INT_PARAM_FLAG() [1/2]
INT_PARAM_FLAG |
( |
max_image_MB |
, |
|
|
2000 |
, |
|
|
"Max memory to use for images." |
|
|
) |
| |
◆ INT_PARAM_FLAG() [2/2]
INT_PARAM_FLAG |
( |
verbosity |
, |
|
|
1 |
, |
|
|
"Amount of diagnosting information to output (0-2)." |
|
|
) |
| |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
This program reads in a text file consisting of feature samples from a training page in the following format:
FontName UTF8-char-str xmin ymin xmax ymax page-number
NumberOfFeatureTypes(N)
FeatureTypeName1 NumberOfFeatures(M)
Feature1
...
FeatureM
FeatureTypeName2 NumberOfFeatures(M)
Feature1
...
FeatureM
...
FeatureTypeNameN NumberOfFeatures(M)
Feature1
...
FeatureM
FontName CharName ...
The result of this program is a binary inttemp file used by the OCR engine.
- Parameters
-
argc | number of command line arguments |
argv | array of command line arguments |
- Returns
- none
- Note
- Exceptions: none
-
History: Fri Aug 18 08:56:17 1989, DSJ, Created.
-
History: Mon May 18 1998, Christy Russson, Revistion started.
Definition at line 38 of file lstmeval.cpp.
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());
71 if (!tester.LoadAllEvalData(FLAGS_eval_listfile.c_str())) {
72 tprintf(
"Failed to load eval data from: %s\n", FLAGS_eval_listfile.c_str());
77 tester.RunEvalSync(0, &errs, mgr,
const char * string() const
void OverwriteEntry(TessdataType type, const char *data, int size)
bool LoadDataFromFile(const char *filename, GenericVector< char > *data)
bool Init(const char *data_file_name)
void ParseArguments(int *argc, char ***argv)
◆ STRING_PARAM_FLAG() [1/3]
STRING_PARAM_FLAG |
( |
model |
, |
|
|
"" |
, |
|
|
"Name of model file (training or recognition)" |
|
|
) |
| |
◆ STRING_PARAM_FLAG() [2/3]
STRING_PARAM_FLAG |
( |
traineddata |
, |
|
|
"" |
, |
|
|
"If model is a training |
checkpoint, |
|
|
then traineddata must " "be the traineddata file that was given to the trainer" |
|
|
) |
| |
◆ STRING_PARAM_FLAG() [3/3]
STRING_PARAM_FLAG |
( |
eval_listfile |
, |
|
|
"" |
, |
|
|
"File listing sample files in lstmf training format." |
|
|
) |
| |