Skip to content

Commit 32e92de

Browse files
committed
Avoid crash with --psm 0 and LSTM traineddata
Orientation and script detect only worked with legacy models and crashed with LSTM models. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 59ebd58 commit 32e92de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/classify/adaptmatch.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,10 @@ void Classify::DoAdaptiveMatch(TBLOB *Blob, ADAPT_RESULTS *Results) {
15411541
&bl_features);
15421542
if (sample == nullptr) return;
15431543

1544+
// TODO: With LSTM, static_classifier_ is nullptr.
1545+
// Return to avoid crash in CharNormClassifier.
1546+
if (static_classifier_ == nullptr) return;
1547+
15441548
if (AdaptedTemplates->NumPermClasses < matcher_permanent_classes_min ||
15451549
tess_cn_matching) {
15461550
CharNormClassifier(Blob, *sample, Results);

0 commit comments

Comments
 (0)