Set tesseract model
This commit is contained in:
@@ -15,7 +15,7 @@ export class Vision {
|
||||
return {
|
||||
abort: () => { worker?.terminate(); },
|
||||
response: new Promise(async res => {
|
||||
worker = await createWorker('eng', 1, {cachePath: this.ai.options.path});
|
||||
worker = await createWorker(this.ai.options.tesseract?.model || 'eng', 2, {cachePath: this.ai.options.path});
|
||||
const {data} = await worker.recognize(path);
|
||||
await worker.terminate();
|
||||
res(data.text.trim() || null);
|
||||
|
||||
Reference in New Issue
Block a user