Version 6 includes important under-the-hood improvements, along with a couple breaking changes.
Major ImprovementscreateWorker
config
argument overwritten by default arguments #975).text
are now disabled by default.
hocr
output (for example), set the following: worker.recognize(image, {}, { hocr: true })
blocks
) was tweaked.
blocks
) is returned.
words
, symbols
, etc.).
text
and bbox
--are unchanged.worker.initialize
and worker.loadLanguage
, along with several depreciated options from v2.The memory leak present in previous versions forced users running Tesseract.js on a server to periodically create fresh workers. Even though this should no longer be necessary to avoid a memory-related crash, server users should still occasionally create new workers.
This is because Tesseract workers "learn" over time by default. While this learning generally improves results, it assumes that (1) previous results are generally correct and (2) the image that is being recognized closely resembles previous images. As a result, if the same worker is used with hundreds of different documents from different users, it is common for Tesseract to "learn" something incorrect or inapplicable, making results worse than had a fresh worker be used.
Why were non-text output formats disabled by default?Previous versions of Tesseract.js exported results to 4 different formats by default. After analyzing performance, we found that the unnecessary formats were routinely adding 0.25-0.50s per page to runtime when recognizing documents, in addition to increasing memory usage. Therefore, requiring users to manually specify any non-text format(s) they need should result in non-trivial performance gains.
Why was the JavaScript object output (blocks
) changed?
While there are several reasons why minor changes were made to this format, the primary goal was fixing memory leaks present in the previous implementation. The new version is free of leaks, runs faster, and should be easier to maintain. Note: if any blocks
output property that you rely on was cut in this release, please leave a comment and we can consider adding it back.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4