Comments (3)
Was this a one-time thing that was resolved once you deleted/refreshed the cache data, or can it be replicated? If it can be replicated, please provide a reproducible example.
from tesseract.js.
I couldn't find where it stores the cache and setting langPath didn't seem to have any effect. Where can I find the cache data? For now I have disabled the cache but if I enable it again I think it will happen again, and then I can share these cached files so that the bug can be replicated
from tesseract.js.
Files are cached at ${cachePath}/${lang}.traineddata
, where cachePath
is determined by the cachePath
argument (.
by default). For the browser version of Tesseract.js the file is cached in IndexDB
, and for the Node.js version of Tesseract.js the file is cached on the local file system.
For example, the following snippet will download eng.traineddata
from IndexDB on browser. It must be run from the devtools console on a website that has previously saved eng.traineddata
to the cache.
(async () => {
// Open a connection to the database
const openRequest = indexedDB.open('keyval-store');
const db = await new Promise((resolve, reject) => {
openRequest.onerror = () => reject(openRequest.error);
openRequest.onsuccess = () => resolve(openRequest.result);
});
// Start a transaction and get the object store
const transaction = db.transaction(['keyval'], 'readonly');
const store = transaction.objectStore('keyval');
// Use the key to get the file as a Blob
const getRequest = store.get('./eng.traineddata');
const data = await new Promise((resolve, reject) => {
getRequest.onerror = () => reject(getRequest.error);
getRequest.onsuccess = () => resolve(getRequest.result);
});
const blob = new Blob([data], {type: 'application/octet-stream'});
// Create a URL for the blob
const url = URL.createObjectURL(blob);
// Create a temporary anchor element to trigger download
const a = document.createElement('a');
a.href = url;
a.download = 'eng.traineddata';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
// Revoke the blob URL after download
URL.revokeObjectURL(url);
})();
from tesseract.js.
Related Issues (20)
- Switch from CommonJS to ESM modules HOT 1
- setImage is re-run unnecessarily when rotateAuto is enabled
- `debug` output missing from types HOT 1
- Custom traindata do not work HOT 2
- possibility to capture stderr HOT 3
- JSDelivr CDN not accessible in China HOT 8
- Large images cause excessive memory usage
- 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 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.