Skip to content

Commit

Permalink
Avoid crash with --psm 0 and LSTM traineddata
Browse files Browse the repository at this point in the history
Orientation and script detect only worked with legacy models
and crashed with LSTM models.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Oct 8, 2018
1 parent 59ebd58 commit 32e92de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/classify/adaptmatch.cpp
Expand Up @@ -1541,6 +1541,10 @@ void Classify::DoAdaptiveMatch(TBLOB *Blob, ADAPT_RESULTS *Results) {
&bl_features);
if (sample == nullptr) return;

// TODO: With LSTM, static_classifier_ is nullptr.
// Return to avoid crash in CharNormClassifier.
if (static_classifier_ == nullptr) return;

if (AdaptedTemplates->NumPermClasses < matcher_permanent_classes_min ||
tess_cn_matching) {
CharNormClassifier(Blob, *sample, Results);
Expand Down

0 comments on commit 32e92de

Please sign in to comment.