Closed Kishlay-notabot closed 10 months ago
Running tesseract locally is getting very confusing.
In the docs I read about the dev server, and when i read the code I see mentions of the dist directory, but there is no dist directory to be seen.
Edit: dist directory seems to be in the CDN, sorry but im still confused
Someone please guide me and clear this fog over this, how to run tesseract independently, offline and please clear up all the mess of these different versions, node, browser and vanilla js [I've been using vanilla directly in npm and there seems to be no issue running the program, but in order to get a front end, I have to incorporate the html code]
When I run tesseract using npm installation [basic node app
(see code below)] and use a simple js only script, it downloads the respective .traineddata in the same folder,
const Ts = require("tesseract.js");
Ts.recognize('./tss.jpg', 'hin', {
logger: e => console.log(e),
tessedit_pageseg_mode: Ts.PSM.SINGLE_CHAR,
})
.then(out => console.log(out))
but when we use browser mode, does the processing and unpacking happen in the cdn? Am i right?
This repo contains multiple examples, for both browser and Node.js. If you are having trouble getting started you should start by running those.
If you want to run Tesseract.js recognition entirely from your local server and/or local system, without trying to access a CDN, review the instructions in the documentation here.
The demo.html
file your original post mentions does not exist, as it was replaced with other examples. I will update the documentation to remove any remaining references to this file now to avoid future confusion.
This repo contains multiple examples, for both browser and Node.js. If you are having trouble getting started you should start by running those.
If you want to run Tesseract.js recognition entirely from your local server and/or local system, without trying to access a CDN, review the instructions in the documentation here.
The
demo.html
file your original post mentions does not exist, as it was replaced with other examples. I will update the documentation to remove any remaining references to this file now to avoid future confusion.
I did check the documentation and the examples, i tried to run the server, it it throwed up the cannot get
error.
Thanks anyway, I'll recheck the links you have provided.
The demo.html file your original post mentions does not exist, as it was replaced with other examples. I will update the documentation to remove any remaining references to this file now to avoid future confusion.
The documentation mentioned that specific link, yes.
And,
This repo contains multiple examples, for both browser and Node.js. If you are having trouble getting started you should start by running those.
I did read these links, but where specifically is the /dist/
directory located?
Edit: the repo got updated, I'll try running it again. If it works, I'll close the issue
I did read these links, but where specifically is the
/dist/
directory located? Where can I download the JS file package
Run npm run build
to build the static files in the dist
directory. This also happens automatically if you run npm start
.
The example codes successfully work for the node installation, but I am facing trouble running it locally, and there is no proper or updated series of steps mentioned in the readme files to do it.
I do not understand what you mean by saying that the example code works but you were not able to run it locally.
I did read these links, but where specifically is the
/dist/
directory located? Where can I download the JS file packageRun
npm run build
to build the static files in thedist
directory. This also happens automatically if you runnpm start
.The example codes successfully work for the node installation, but I am facing trouble running it locally, and there is no proper or updated series of steps mentioned in the readme files to do it.
I do not understand what you mean by saying that the example code works but you were not able to run it locally.
Sorry, I did not realize that Node version is also technically locally run . And yes thanks the local browser environment server now works.
Earlier I failed to realize that actually both are same.
Tesseract.js version (version number for npm/GitHub release, or specific commit for repo) Latest version 5.0.4
Describe the bug A clear and concise description of what the bug is. After cloning the repo, running npm install and then npm start, the command line shows up successful outputs but when I open the server link at http://localhost:3000/examples/browser/demo.html
To Reproduce Steps to reproduce the behavior:
Expected behavior Locahost dev server running succesfully
Device Version: