Comments (9)
Do you have reason to believe that this issue is specific to IBM i, or is that simply extra context? Can you provide an example repo (or standalone flie) that is sufficient to reproduce this error? As await createWorker("eng")
should run, the snippet above is not enough to go off of.
On a completely unrelated note, it is generally inadvisable to create new workers within the function that runs recognition within real applications. The reason is that, in addition to creating overhead every time the function is run, there is no limit to the number of workers that can end up being created. As a result, you either end up running 1 recognition job at a time to be safe (which is slow), or allowing for an unlimited number of jobs to run at the same time, which can crash your application.
The recommended approach is to create a scheduler. This allows you to define a fixed number of workers (say, 4) that persist between jobs, and use them to run recognition in parallel. See this guide for an explanation.
from tesseract.js.
Repository
https://github.com/gregorysababady/filereader
I already tried it on a windows server and it works just fine.
Thanks for the advise, yeah I definitely need to correct this out !
from tesseract.js.
Several of the dependencies in your repo's package.json
don't install on Linux. Regardless, a more minimal example would be more useful for determining if there is a platform-specific issue with IBM i machines. Can you try running the basic example from the README on your system?
import { createWorker } from 'tesseract.js';
(async () => {
const worker = await createWorker('eng');
const ret = await worker.recognize('https://tesseract.projectnaptha.com/img/eng_bw.png');
console.log(ret.data.text);
await worker.terminate();
})();
If the issue is with createWorker
not being able to run on this platform, then this basic example code should fail. If it runs properly, then I think the issue is something else in your codebase. Note that the function path.resolve
is not actually used in this repo (outside of example scripts and build code), so it is unclear to me how your code could be failing at the createWorker
step with this error message.
from tesseract.js.
This not working either, getting same path.resolve error.
On windows it works just fine.
The issue is coming from tesseract.js-core packages:
from tesseract.js.
Thanks for confirming. Unless there is something particular about your settings, it sounds like there is indeed some platform-specific issue with IBM i.
It looks like the code in question is not originally from either the Tesseract.js or Tesseract.js-core repos, but rather is code that is added by Emscripten, which is the compiler used to go from C/C++ to webassembly.
I am currently not sure what is happening here. It appears to be something filesystem-related. Upon a brief search of the emscripten issues I did not see any references to IBM i.
from tesseract.js.
Ok so there's no solution to it ?
from tesseract.js.
So is there going to be a new patch soon ?
from tesseract.js.
It is likely that this can be fixed, however that would require troubleshooting by you or another IBM i user to figure out what the root cause is. I am not able to troubleshoot a platform-specific issue on a proprietary platform that I do not have access to.
from tesseract.js.
Thank you and by the way there is this pulbic server available to anyone https://pub400.com
You can create credentials and test the code directly there !
That's the same working environment as on my machine.
Thank you for your help, its much appreciated !
from tesseract.js.
Related Issues (20)
- Worker stuck on "loading language traineddata" HOT 4
- Updated types to infer output formats
- Inference of Chinese handwritten characters is bad HOT 3
- Add line size metrics (ascender, descender, size) to `line` objects in `blocks` output HOT 1
- Font attributes incorrect even when font is properly identified (`is_italic`, `is_serif`, etc.) HOT 1
- Focusing area HOT 1
- Multiple issues: Discussion
- Disable non-text output formats by default
- Tesseract - Running in Browser Console HOT 1
- Execution `worker.recognize` repeatedly causes "Out of Memory" error in JSFiddle HOT 5
- Error: Network error while fetching HOT 1
- how to use installed tessercat lib on windows for tesseract.js? HOT 1
- createWorker throws exception with option.langPath set in electron HOT 7
- Auto fill forms by scanning ID cards
- Suppressing "Corrupt JPEG data: 1 extraneous bytes before marker 0xd9" output HOT 3
- Legacy model does not work for indic and arabic scripts due to Legacy data being removed
- Combine worker and scheduler interfaces
- Issue with Tesseract.js OCR Integration in Angular Application HOT 5
- Rectangles not working, pure white image interpreted as tildes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tesseract.js.