Coder Social home page Coder Social logo

Comments (5)

ImSpyke avatar ImSpyke commented on September 27, 2024 1

I am working on this project with matthieu, dont hesitate to ping me too if you have any solutions ^^

from tesseract.js.

matthieuEv avatar matthieuEv commented on September 27, 2024

Any news? :)

from tesseract.js.

Balearica avatar Balearica commented on September 27, 2024

Please provide an example image that can be used to replicate this issue.

from tesseract.js.

Balearica avatar Balearica commented on September 27, 2024

I would like to know if there is a way to suppress this specific output from being logged to the console. I have attempted to use custom logger functions, but the message still appears. Temporarily overriding console.log, console.warn, and console.error works, but it feels like a hack rather than a solution.

Since these warning messages are created by Tesseract rather than being something added by Tesseract.js, disabling specific warning messages at the source is outside of the scope of this repo. Indeed, the only way filter messages Tesseract prints to stderr without modifying the Tesseract codebase would be to implement the hacky solutions you describe (e.g. overriding console.log).

However, Tesseract does support saving warning messages as an output, rather than printing them to stderr (which maps to console.warn in JavaScript). Therefore, by redirecting the messages to the output, you should be able to implement something similar to what you are describing. To capture debugging messages in the output object, rather than printing them to console, set the debug to true within the output options.

const worker = await await Tesseract.createWorker("eng");
const ret = await worker.recognize(files[i], undefined, {debug: true});
console.log(ret.data.text);
console.log(`Captured message: ${ret.data.debug}`);
Captured message: Estimating resolution as 390

Once you have the debug output string, you can either ignore it or save it to a string--essentially suppressing all warning messages from the console--or write a wrapper function that prints warnings only when they meet certain criteria.

from tesseract.js.

matthieuEv avatar matthieuEv commented on September 27, 2024

Hello, sorry for my inactivity hereπŸ˜…, this method seems to work for me, thanks again 😁

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.