- training.models.CTCDecoder: prefer beam search over greedy
(because it is more accurate)
- training reload makefile: skip ONNX and TF-Serving conversion
for cnn-rnn-ocr models (because these would not work)
- training reload makefile: default to onnx and tf conversions
for all models (tf for training and onnx for inference)
instead of tf-serving export
- `training.models.CTCDecoder`: switch back
from `tf.nn.ctc_beam_search_decoder()`
to `tf.nn.ctc_greedy_decoder()`
(because ONNX only implements `CTCGreedyDecoder`)
- `training.models.cnn_rnn_ocr_model(inference=True)` and
`training.models.cnn_rnn_ocr_model4inference`:
drop layer `tf.io.decode_raw()`
(because ONNX does not implement `DecodePaddedRaw`)
- `Eynollah_ocr.run_cnn()`: expect bytes arrays from predictor
instead of uint8
- `predictor`: to prevent segfaults when sending `tf.string` results
via `shared_memory`, convert `np.object` to `np.bytes_` directly
when rebuilding the inference model for cnn-rnn-ocr,
- open the old `characters_org.txt` file for the charset
- use it to pass the actual `n_classes` (overriding the config)
- use its path to pass the `characters_txt_file` (overriding the config)
Because transformers v4 and v5 API for image preprocessor differs,
and the model-internal image input sizes are actually irrelevant,
because the preprocessor will resize them anyway, and there is no
batch dimension (because the input images will have different shapes),
do not advertise this information in `.input_shape`.
- ModelZoo: drop `trocr_processor` model type
- `ModelZoo.load_models()`: use Predictor for `ocr_tr` models, too
- `ModelZoo.load_model()`: for `ocr_tr`, load processor and model,
then define a function object as stand-in for the common model
interface based on Keras (w/ `.predict_on_batch()`)
- Predictor: allow multi-input without actual batch dimension
for `ocr_tr` models (because the model takes a list of original
image arrays and resizes them to model shape internally)
- Eynollah_ocr: adapt (replacing preprocessing, prediction and
decoding steps by a single `.predict()` call)
- `min_conf_value_of_textline_text`: apply by skipping
lines below threshold (instead of writing empty text),
and delete their TextEquiv (if existing)
- `write_ocr()`: simplify, and ensure consistency between
line and region level text correctly