Merge pull request #2751 from stweil/master

Fix issue #2748
This commit is contained in:
Egor Pugin 2019-11-08 21:43:23 +03:00 committed by GitHub
commit 944c1d9bff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -62,7 +62,7 @@ bool Tesseract::TrainLineRecognizer(const STRING& input_imagename,
return false; return false;
} }
TrainFromBoxes(boxes, texts, block_list, &images); TrainFromBoxes(boxes, texts, block_list, &images);
if (images.NumPages() <= 0) { if (images.PagesSize() == 0) {
tprintf("Failed to read pages from %s\n", input_imagename.c_str()); tprintf("Failed to read pages from %s\n", input_imagename.c_str());
return false; return false;
} }

View File

@ -233,6 +233,9 @@ class DocumentData {
std::lock_guard<std::mutex> lock(general_mutex_); std::lock_guard<std::mutex> lock(general_mutex_);
return total_pages_; return total_pages_;
} }
size_t PagesSize() const {
return pages_.size();
}
int64_t memory_used() const { int64_t memory_used() const {
std::lock_guard<std::mutex> lock(general_mutex_); std::lock_guard<std::mutex> lock(general_mutex_);
return memory_used_; return memory_used_;