Commit Graph

5815 Commits

Author SHA1 Message Date
Egor Pugin
e9a2fc0083 More std::string replacements. 2021-03-10 14:36:59 +03:00
Egor Pugin
73a325494e
[cmake] Require C++17. 2021-03-10 00:41:47 +03:00
Stefan Weil
0f1296c6f6 Clean implementation for (de-)serialization of a vector
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-08 13:33:48 +01:00
Egor Pugin
0cd6a07e42
Update .travis.yml 2021-03-08 03:02:25 +03:00
Stefan Weil
6cfe604d58 Fix serialization for vector of RecodedCharID
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-07 23:01:25 +01:00
Shreeshrii
33868a52ae
Travis: build linux matrix (#3320) 2021-03-07 19:31:02 +01:00
Egor Pugin
576c064b44
Merge pull request #3318 from Shreeshrii/travis
Add multiple architectures for travis run
2021-03-06 12:20:25 +03:00
Shree Devi Kumar
4fd0bca6c9 Add multiple architectures for travis run 2021-03-06 08:30:14 +00:00
Stefan Weil
0cde3ede98 Add heuristic to fix swap (partially fixes issue #2586)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-05 14:27:28 +01:00
Stefan Weil
a2769aebb4 Replace GenericVector<TBOX> by std::vector<TBOX>
Fix also endianness handling for (de)serialisation of TBOX.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-05 14:27:28 +01:00
Stefan Weil
c31c1a7d60 Fix two compiler warnings for serialis.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-05 14:27:28 +01:00
Stefan Weil
fe614c6069 Enable less FP exceptions for clang compiler when running tesseract
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-03 22:56:07 +01:00
Egor Pugin
c39b1daa6b GenericVector -> std::vector. 2021-03-03 22:22:00 +03:00
Egor Pugin
0a693a9519 Allow to serialize std vectors with classes from TFile. Implementation from GenericVector. 2021-03-03 22:21:40 +03:00
Stefan Weil
ff830775f9 Fix memory leak in DocumentCache
It was introduced in commit 5cac52173e.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-01 11:31:48 +01:00
Stefan Weil
339c01894e Avoid fp division by 0 (fix issue #3314)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-28 19:42:01 +01:00
Egor Pugin
838a754d24
Merge pull request #3313 from stweil/learning_rate
Add new checks for floating point errors and fix a division by zero
2021-02-27 23:20:09 +03:00
Stefan Weil
cd60728e8a Avoid float division by zero when calculating adaptive learning rate
The following line results in a division by zero when
momentum is -1 and num_samples is even:

     learning_rate /= 1.0f - pow(momentum, num_samples);

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-27 21:08:41 +01:00
Stefan Weil
c12dde2862 Use float instead of double for learning_rate, momentum and adam_beta
Only WeightMatrix::Update used double parameters, all other functions
already used float. So this change avoids unnecessary conversions.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-27 21:08:41 +01:00
Stefan Weil
422452b9f4 Check for float errors when running tesseract and lstmtraining
Some illegal floating point calculations like division by zero,
illegal value or overflow will now abort tesseract with an error
message.

For lstmtraining there is now a new parameter --debug_float to
enable the same kind of checks. It is currently disabled by default
because such errors occur and would abort the training process.
That should be fixed in the future.

If tesseract also shows floating point errors which cannot be
fixed easily, a similar parameter to enable the checks can be
added there, too.

The new code requires the function feenableexcept which is only
available with the GNU libc, so it is only used on Linux.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 21:49:27 +01:00
Stefan Weil
51a214a51b Remove unused include statements for imagedata.h and document used ones
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 21:42:28 +01:00
Stefan Weil
1d7a981203 Disable code for unused classes WordFeature and FloatWordFeature
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 21:42:17 +01:00
Stefan Weil
5cac52173e Replace PointerVector by std::vector in class DocumentCache
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 21:42:07 +01:00
Stefan Weil
387acd9881 Initialize weight matrix with 0.0 (fix issue #3229)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 18:49:39 +01:00
Egor Pugin
1ab6b0fbc6
Merge pull request #3311 from stweil/master
Replace calls of exit function
2021-02-26 17:43:53 +03:00
Stefan Weil
58304cbfdd Don't compile OpenCL code when OpenCL is disabled
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 15:40:23 +01:00
Stefan Weil
a6946c3bf9 Replace calls of exit function
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 14:22:36 +01:00
Stefan Weil
373a3527ec Format code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 14:22:09 +01:00
Stefan Weil
ea446b1eae Remove blanks at line endings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-26 14:05:36 +01:00
Stefan Weil
394c56ab15 Replace GenericVector by std::vector in class WERD_CHOICE
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 23:14:25 +01:00
Egor Pugin
b030b03e0d
Update configure.ac 2021-02-24 01:09:44 +03:00
Egor Pugin
c877c368a1
Merge pull request #3309 from stweil/std
Replace more STRING and GenericVector variables and other code maintenance
2021-02-24 01:04:03 +03:00
Egor Pugin
90afdef30d
Merge pull request #3162 from xloem/android
Specify ADD_RT for android platform, which embeds librt in libc
2021-02-24 00:22:17 +03:00
Stefan Weil
fccecb2d23 Replace GenericVector by std::vector in class ResultIterator
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 21:07:57 +01:00
Stefan Weil
2257028052 Replace GenericVector by std::vector in reject.cpp
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 21:06:59 +01:00
Stefan Weil
d62f27dd8f Replace GenericVector by std::vector in stepblob.cpp
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 20:47:06 +01:00
Stefan Weil
3e5b2760ab Replace GenericVector by std::vector for struct BlamerBundle
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 20:34:41 +01:00
Stefan Weil
0b8e937655 Use countof to get number of array elements
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 20:20:48 +01:00
Stefan Weil
7097dfd41c Replace GenericVector by std::vector for parameters
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 20:20:48 +01:00
Stefan Weil
f2d2695ce9 Replace STRING and clean declarations of local variables in eval_word_spacing
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 20:20:48 +01:00
Stefan Weil
5277443833 Replace more STRING
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-23 20:20:48 +01:00
Stefan Weil
ae00f291f6 Remove unused include statements
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-22 22:28:47 +01:00
Egor Pugin
8081cae82e
Merge pull request #3305 from Shreeshrii/vcpkg-cmake-win
Actions CI: Add workflow to build tesseract using vcpkg and cmake
2021-02-20 14:25:15 +03:00
Shree Devi Kumar
b99ff07f64 Actions CI: Add workflow to build tesseract and basicapitest using vcpkg and cmake 2021-02-20 09:33:15 +00:00
Egor Pugin
a219d64811
Merge pull request #3302 from Shreeshrii/PR1
Actions CI: Remove gcc from macOS CI
2021-02-15 17:07:57 +03:00
Shree Devi Kumar
efba7535f0 Actions CI: Remove gcc from macOS CI 2021-02-15 14:04:29 +00:00
Egor Pugin
0b35605420
Merge pull request #3300 from Shreeshrii/autocmake
Formatting changes and basicapitest.cpp from test/testing for Actions CI
2021-02-13 20:41:02 +03:00
Shree Devi Kumar
642e2ac9c1 Link to basicapitest in test/testing for Actions CI 2021-02-13 17:20:36 +00:00
Stefan Weil
65053890d7 Handle file list without terminating LF (fix issue #3298)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-13 11:44:47 +01:00
Stefan Weil
3d5fea6355 Update test submodule
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-02-13 11:02:48 +01:00