Giter VIP home page Giter VIP logo

Comments (6)

Balearica avatar Balearica commented on May 24, 2024

Please describe when you've encountered this issue and how to replicate. Both issues you've linked state that this issue occurs when running a bash script to generate new training data, which is not something we support in Tesseract.js. Additionally, these issues indicate the problem was already solved in early 2021.

from tesseract.js.

Melmacker avatar Melmacker commented on May 24, 2024

I use tesseract.min.js, in GTA5 third party application called FiveM, to detect some text on the screen.
What I can track down with my knowledge was that it happens when you enter an base 64 image string like attached.
base64imagestring.txt
image

from tesseract.js.

Balearica avatar Balearica commented on May 24, 2024

Using the base 64 string you provided, I was able to replicate Tesseract.js printing this message.

Image too small to scale!! (2x36 vs min width of 3)
Line cannot be recognized!!

That being said, I do not believe this message being printed indicates a bug in Tesseract.js. Tesseract.js did not crash and recognition appeared to run as expected. As the message itself was produced by Tesseract (not Tesseract.js-specific code), editing the underlying code is outside of the scope of this project. Tesseract.js is intended to port Tesseract to run with JavaScript--we do not make changes to the Tesseract recognition engine. If you believe you found a bug with Tesseract, you should replicate using the main project and then report there.

If the core issue is simply that you are annoyed by messages from Tesseract being printed to the console, you can change this behavior by setting debug: true in the recognition output options. With this option, the text will instead be reported in the output object rather than printed to console.

worker.recognize(img1, undefined, {debug: true})

from tesseract.js.

Melmacker avatar Melmacker commented on May 24, 2024

Thank you very much, but I have one last question. If I set the debug to true or false it doesn't change anything (it still spammed my console).
Tesseract.recognize(event.data.data, 'eng', {debug: true}).then(({ data: { text } }) => {do something});
I also tried two more unnatural method, but they didn't work for me either.
Tesseract.recognize(event.data.data, 'eng', {logger: m => {}}).then(({ data: { text } }) => {do something});
Tesseract.recognize(event.data.data, 'eng', {errorHandler: m => {}}).then(({ data: { text } }) => {do something});
Do you have another tip for me?

from tesseract.js.

Balearica avatar Balearica commented on May 24, 2024

@Melmacker Tesseract.recognize does not contain an output argument, so adding {debug: true} does not do anything. The worker.recognize method contains an output argument that you would set to {debug: true}.

Tesseract.recognize is an extremely simple function that exists primarily for the sake of new users experimenting with Tesseract.js. To have full control and the best performance, you need to manage the worker objects directly. This is explained in the intro guide.

from tesseract.js.

Melmacker avatar Melmacker commented on May 24, 2024

Thank you verry much. Now I got it 😅
Keep up the good work.

from tesseract.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.