Commit Graph

389 Commits

Author SHA1 Message Date
Stefan Weil
5af6cacf84 Restore original congruential random number generator
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
This reverts commit 32fee19447
("Fix linear congruential random number generator"),
commit 2252936fc8
("Use linear congruential random number generator from C++11.")
and commit 7b8af67eb5
("[test] Fix intsimdmatrix test. Update result value based on updated TRand engine.").

It restores the original congruential random number generator
and the related unittest.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-11-23 09:53:09 +01:00
Egor Pugin
63be216814 Convert ELIST2 into template. 2024-11-23 00:25:29 +03:00
Egor Pugin
4991295a39 Convert ELIST into template. 2024-11-23 00:25:29 +03:00
Egor Pugin
ffb33795a8 Fix warnings. 2024-11-23 00:25:29 +03:00
Egor Pugin
45af23d9a6 Update test. 2024-11-23 00:25:29 +03:00
Stefan Weil
cdb7ff90e4 Update submodule googletest to release v1.15.2
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-11-08 20:30:36 +01:00
Stefan Weil
2a1ce80a42 Fix compilation of unittest/third_party/utf/rune.c
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-11-08 08:15:59 +01:00
Stefan Weil
d7c0a05ffa Remove Tensorflow support
Tensorflow was never used because of missing models.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-11-07 13:40:43 +01:00
Stefan Weil
60ed299550 Make downloads with curl silent in build process
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-11-02 07:37:19 +01:00
Stefan Weil
6be58e54fa Initialize variables in initialization list
This fixes several performance issues reported by Coverity:

    Variable 'master_trainer_' is assigned in constructor body.
    Consider performing initialization in initialization list.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-08-26 13:16:09 +02:00
Stefan Weil
fc50324986
Replace access/_access by std::filesystem::exists (#4307)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-08-25 18:57:22 +02:00
Stefan Weil
08e9ba8b2e Add double quotes to prevent globbing and word splitting
This fixes some issues which were reported by Codacy.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-06-11 20:02:39 +02:00
Stefan Weil
6cb49dcebd Fix more code style issues (reported by Codacy)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-06-11 20:02:39 +02:00
Stefan Weil
560529332c Fix more code style issues (reported by Codacy)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-06-11 17:52:58 +02:00
Stefan Weil
24dd72603b Fix compiler warnings [-Wunreachable-code-return]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-05-20 07:46:07 +02:00
Stefan Weil
bcc1a3b45b Rename frk -> deu_latf (ISO 639-3, ISO 15924)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-03-09 11:25:28 +01:00
Stefan Weil
fbff9362ce Fix some typos
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-02-22 07:55:33 +01:00
Stefan Weil
0f56340151 Improve format of logging from lstmtraining
- always use C ("classic") locale
- limit output of floating point values to 3 digits
- remove unneeded linefeed after log message "wrote checkpoint"

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2023-05-05 12:28:24 +02:00
Stefan Weil
f9c5e99e44 Use static linker flags for OSS-Fuzz build
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-03-03 12:51:46 +01:00
Stefan Weil
a77c337a28 Update linker flags for OSS-Fuzz build
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-03-02 14:38:19 +01:00
Stefan Weil
76faf16006 Fix old TODO (STATS::rangemax_)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-02-03 09:15:31 +01:00
Stefan Weil
a185c068d1 Update submodule googletest to release v1.11.0
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2022-01-01 18:50:24 +01:00
Stefan Weil
d754593a31 Catch nullptr in STATS::pile_count (fix isse #3694)
Add also a test case for this issue.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-12-29 17:26:32 +01:00
Stefan Weil
b649222de3 Fix resultiterator_test with --disable-legacy
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-11-20 14:58:36 +01:00
Amit D
75253a24c7
Improve the disable legacy build (#3649)
resultiterator_test: Disable some parts of EasyTest.
2021-11-19 10:52:18 +02:00
Amit D
ff11f5dc65
Improve disable legacy build (#3648)
resultiterator_test: Disable SmallCapDropCapTest

Co-authored-by: Shree Devi Kumar <5095331+Shreeshrii@users.noreply.github.com>
2021-11-18 16:07:55 +02:00
Amit D
49715f4d27
pagesegmode_test.cc: Disable some code for disable legacy build (#3626)
Co-authored-by: Shree Devi Kumar <5095331+Shreeshrii@users.noreply.github.com>
Co-authored-by: Stefan Weil <sw@weilnetz.de>
2021-11-04 12:49:32 +01:00
Stefan Weil
7058bbf282 Move googletest to unittest/third_party/googletest
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-11-01 11:50:50 +01:00
Stefan Weil
a7a729f6c3 Disable CI checks which are no longer valid with NFC normalization
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-10-27 19:15:44 +02:00
Stefan Weil
638045133f Simplify function LoadTrainingData and fix mastertrainer_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-09-17 08:24:50 +02:00
Stefan Weil
63c12a9ee5 unittest: Enable more code for tatweel_test without requiring Tensorflow
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-12 14:12:53 +02:00
Stefan Weil
2215174951 unittest: Fix compiler warning for unused function
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-07 18:14:50 +02:00
Stefan Weil
49f410ced3 unittest: Remove dependency on absl::StripAsciiWhitespace()
This removes the last dependency on Abseil, so that submodule
is now removed completely.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-06 20:59:10 +02:00
Stefan Weil
87707bb8b0 unittest: Remove dependency on absl::StrSplit()
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-06 20:59:09 +02:00
Stefan Weil
f407345cbe unittest: Remove dependency on absl::StrJoin()
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-06 20:59:09 +02:00
Stefan Weil
61b8e301dd unittest: Remove dependency on absl::StrCat()
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-06 20:59:09 +02:00
Stefan Weil
8486f59493 unittest: Remove dependency on absl::StrFormat()
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-06 20:59:09 +02:00
Stefan Weil
fe5ca9dad9 unittest: Remove dependency on absl::GetCurrentTimeNanos()
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-06 20:59:09 +02:00
Stefan Weil
6b8b1f0007 unittest: Remove some dependencies on abseil
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-08-06 20:59:09 +02:00
Stefan Weil
c9f42ce62b
Add unittest for static TessBaseAPI object (#3509)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-07-25 14:34:43 +03:00
Stefan Weil
472f5d9020 Add TFloat data type for neural network
Up to now Tesseract used double for training and recognition
with "best" models.

This commit replaces double by a new data type TFloat which
is double by default, but float if FAST_FLOAT is defined.

Ideally this should allow faster training.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-07-24 15:14:17 +02:00
Stefan Weil
915c29e3c8 Fix IntSimdMatrixTest.AVX2
Fixes: 872816897a
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-07-04 09:07:35 +02:00
Stefan Weil
93348a83a3 Remove scripts for training
They were replaced by Python3 scripts (part of the tesstrain repository).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-05-18 10:47:44 +02:00
Stefan Weil
d4bcbbd6de Add test for TessBaseAPI::ClearPersistentCache to unit tests
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-05-17 09:28:21 +02:00
Stefan Weil
0401b9470c Fix some typos (most found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-04-11 11:06:36 +02:00
Stefan Weil
f2c6378b5a Fix broken build for fuzzer
This partially reverts commit a792b67983.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-04-09 08:05:55 +02:00
Egor Pugin
9d40512ade [elist2] Convert macros to template. Remove source file macro ELIST2IZE. 2021-04-07 00:15:01 +03:00
Egor Pugin
03435adca0 [elist] Rework macro into template and small macro. Move common iterator template into 'list_iterator.h'. 2021-04-07 00:04:30 +03:00
Egor Pugin
18e61d10ce Rework big clist macro into template and small macro. Remove unused macros QUOTE_IT and CLISTIZE (source file macro). 2021-04-06 23:37:14 +03:00
Egor Pugin
306d296979 Add Image::clone(). 2021-04-01 17:06:30 +03:00