Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognition being run even when disabled #769

Closed
Balearica opened this issue May 29, 2023 · 1 comment
Closed

Recognition being run even when disabled #769

Balearica opened this issue May 29, 2023 · 1 comment

Comments

@Balearica
Copy link
Member

Tesseract.js skips the recognition step when all of the output formats requested do not require recognition. This allows for using Tesseract.js for image processing without waiting for recognition (the step with the longest runtime) to be completed. This behavior will also be critical if we add a way to get layout data without running recognition (requested in #656).

if (recOutputCount > 0) {
api.Recognize(null);
} else {
log('Skipping recognition: all output options requiring recognition are disabled.');
}

Unfortunately, this does not appear to be working correctly at present--recognition is still being run even when we intentionally skip running api.Recognize. It looks like something in the dump function is triggering Tesseract to automatically run recognition under the hood.

@Balearica
Copy link
Member Author

Balearica commented May 29, 2023

The cause ended up being the api.MeanTextConf function, which was always run by dump and appears to automatically trigger recognition.

confidence: api.MeanTextConf(),

Resolved by #770. Will be included in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant